listMachines method

Future<ListMachinesResponse?> listMachines(
  1. String account, {
  2. Object? page,
  3. int? limit,
  4. String? fingerprint,
  5. String? ip,
  6. String? hostname,
  7. String? product,
  8. String? policy,
  9. String? license,
  10. String? key,
  11. String? user,
  12. String? group,
  13. Object? metadata,
})

List all machines

Returns a list of machines. The machines are returned sorted by creation date, with the most recent machines appearing first. Resources are automatically scoped to the authenticated bearer e.g. when authenticated as a user, only machines for that specific user will be listed.

Parameters:

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

  • Object page: Object containing page size and page number.

  • int limit:

  • String fingerprint: The machine fingerprint to filter by.

  • String ip: The machine IP address to filter by.

  • String hostname: The machine hostname to filter by.

  • String product: The identifier (UUID) of the product to filter by.

  • String policy: The identifier (UUID) of the policy to filter by.

  • String license: The identifier (UUID) or key of the license to filter by.

  • String key: The license key to filter by.

  • String user: The identifier (UUID) of the user to filter by.

  • String group: The identifier (UUID) of the group to filter by.

  • Object metadata: The metadata object to filter by.

Implementation

Future<ListMachinesResponse?> listMachines(String account, { Object? page, int? limit, String? fingerprint, String? ip, String? hostname, String? product, String? policy, String? license, String? key, String? user, String? group, Object? metadata, }) async {
  final response = await listMachinesWithHttpInfo(account,  page: page, limit: limit, fingerprint: fingerprint, ip: ip, hostname: hostname, product: product, policy: policy, license: license, key: key, user: user, group: group, metadata: metadata, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ListMachinesResponse',) as ListMachinesResponse;

  }
  return null;
}