Table of Contents

Interface IDeviceSensorCommands

Namespace
Meraki.Api.Interfaces.General.Devices
Assembly
Meraki.Api.dll
public interface IDeviceSensorCommands
Extension Methods

Methods

CreateDeviceSensorCommandAsync(string, SensorCommandCreateRequest, CancellationToken)

Sends a command to a sensor

[Post("/devices/{serial}/sensor/commands")]
Task<SensorCommand> CreateDeviceSensorCommandAsync(string serial, SensorCommandCreateRequest createDeviceSensorCommand, CancellationToken cancellationToken = default)

Parameters

serial string

The serial number

createDeviceSensorCommand SensorCommandCreateRequest

Body

cancellationToken CancellationToken

Returns

Task<SensorCommand>

Exceptions

ApiException

Thrown when fails to make API call

GetDeviceSensorCommandAsync(string, string, CancellationToken)

Returns information about the command's execution, including the status

[Get("/devices/{serial}/sensor/commands/{commandId}")]
Task<SensorCommand> GetDeviceSensorCommandAsync(string serial, string commandId, CancellationToken cancellationToken = default)

Parameters

serial string

Serial

commandId string

CommandId

cancellationToken CancellationToken

The cancellation token

Returns

Task<SensorCommand>

A SensorCommand

GetDeviceSensorCommandsAsync(string, List<string>?, int?, string?, string?, string?, string?, string?, CancellationToken)

Returns a historical log of all commands

[Get("/devices/{serial}/sensor/commands")]
Task<List<SensorCommand>> GetDeviceSensorCommandsAsync(string serial, List<string>? operations = null, int? perPage = 1000, string? startingAfter = null, string? endingBefore = null, string? t0 = null, string? t1 = null, string? timespan = null, CancellationToken cancellationToken = default)

Parameters

serial string

Serial

operations List<string>

Optional parameter to filter commands by operation

perPage int?

The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10.

startingAfter string

A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

endingBefore string

A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

t0 string

The beginning of the timespan for the data. The maximum lookback period is 30 days from today.

t1 string

The end of the timespan for the data. t1 can be a maximum of 30 days after t0.

timespan string

The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 1 day.

cancellationToken CancellationToken

The cancellation token

Returns

Task<List<SensorCommand>>

A list of SensorCommand