listMachines method
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 pagenumber
. -
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;
}