getNetworkById method
Returns one overlay network by id, scoped to the caller's org.
Returns one overlay network by id, scoped to the caller's org. The org has exactly one overlay network and its id is derived from the org, so any other id — another tenant's, or one that does not exist — is 404 rather than a peek across the tenant boundary. An org whose network exists but has no edge-routers is 404 too, for the same reason the list is empty: there is no overlay until something is on it.
Parameters:
- String id (required): ID is the network id from the path. The URL is the addressing authority, so it binds from there whatever else the request carries.
Implementation
Future<NetworkView?> getNetworkById(String id,) async {
final response = await getNetworkByIdWithHttpInfo(id,);
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), 'NetworkView',) as NetworkView;
}
return null;
}