pingMachineWithHttpInfo method

Future<Response> pingMachineWithHttpInfo(
  1. String account,
  2. String machine
)

Ping heartbeat

Action to begin or maintain a machine heartbeat monitor. When a machine has not performed a heartbeat ping within the monitor window, it will automatically be deactivated. This can be utilized for machine leasing, where a license has a limited number of machines allowed, and each machine must maintain heartbeat pings in order to remain active. To illustrate further, consider a rather common scenario when dealing with leasing VMs: - The machine is activated for a new device using a unique VM GUID as a "fingerprint." - The machine sends their first heartbeat ping, starting the monitor. - The machine sends further heartbeat pings, within the heartbeat monitor window, to indicate that it is still alive. - The machine/software crashes. Normal machine deactivation fails to occur before the software program exits. This is now a "zombie" machine. - The heartbeat monitor detects that the machine has not sent a ping within the window, and subsequently deactivates the machine. The default heartbeat monitor window is 10 minutes from time of last ping. This can be configured via the license policy's heartbeatDuration attribute. Machines will be culled according to the policy's heartbeat cull strategy, after the machine's resurrection period has passed, if set.

Note: This method returns the HTTP Response.

Parameters:

  • String account (required): The identifier (UUID) or slug of your Keygen account.

  • String machine (required): The identifier (UUID) or URL-safe fingerprint of the machine to ping.

Implementation

Future<Response> pingMachineWithHttpInfo(String account, String machine,) async {
  // ignore: prefer_const_declarations
  final path = r'/accounts/{account}/machines/{machine}/actions/ping'
    .replaceAll('{account}', account)
    .replaceAll('{machine}', machine);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}