File

services/services-device-tab/service-command.service.ts

Index

Methods

Constructor

constructor(operationService: OperationService, alertService: AlertService)
Parameters :
Name Type Optional
operationService OperationService No
alertService AlertService No

Methods

createOperation
createOperation(undefined: Service, command: string)

Create an operation for the selected service command.

Parameters :
Name Type Optional Description
Service No
command string No

The command to execute (e.g., START, STOP).

Returns : Observable<IResult<IOperation>>

Observable of the created operation.

generateActionControls
generateActionControls(commands: string[])

Generate a static list of action controls. The specific logic for each service is handled dynamically in showIf and callback.

Parameters :
Name Type Optional
commands string[] No
Returns : ActionControl[]

Array of ActionControl objects.

getAllSupportedCommands
getAllSupportedCommands(services: Service[])

Get all supported commands for a list of services.

Parameters :
Name Type Optional Description
services Service[] No

The list of service objects to evaluate.

Returns : string[]

Array of all unique supported commands.

getSupportedCommands
getSupportedCommands(service: Service)

Get the list of supported service commands for the given service object.

Parameters :
Name Type Optional Description
service Service No

The service object containing the c8y_SupportedServiceCommands fragment.

Returns : string[]

Array of supported commands.

isCommandSupported
isCommandSupported(service: Service, command: string)

Check if a specific command is supported for the given service.

Parameters :
Name Type Optional Description
service Service No

The service object.

command string No

The command to check (e.g., START, STOP).

Returns : boolean

boolean indicating if the command is supported.

isServiceCommandSupported
isServiceCommandSupported(service: Service)

Check if the service supports service commands.

Parameters :
Name Type Optional Description
service Service No

The service object containing supported operations.

Returns : boolean

boolean indicating if the service supports service commands.

results matching ""

    No results matching ""