Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 2.36 KB

DatabaseApi.md

File metadata and controls

96 lines (62 loc) · 2.36 KB

core_openapi.api.DatabaseApi

Load the API package

import 'package:pieces_os_client/api.dart';

All URIs are relative to http://localhost:3000

Method HTTP request Description
databaseExport GET /database/export Your GET endpoint
databaseImport POST /database/import /database/import [POST]

databaseExport

ExportedDatabase databaseExport()

Your GET endpoint

This is going to export your current database.

Example

import 'package:pieces_os_client/api.dart';

final api_instance = DatabaseApi();

try {
    final result = api_instance.databaseExport();
    print(result);
} catch (e) {
    print('Exception when calling DatabaseApi->databaseExport: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

ExportedDatabase

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

databaseImport

databaseImport(exportedDatabase)

/database/import [POST]

This is going to take in a database, and merge it with the current database. This will revert your database back to it original form if this request fails.

Example

import 'package:pieces_os_client/api.dart';

final api_instance = DatabaseApi();
final exportedDatabase = ExportedDatabase(); // ExportedDatabase | 

try {
    api_instance.databaseImport(exportedDatabase);
} catch (e) {
    print('Exception when calling DatabaseApi->databaseImport: $e\n');
}

Parameters

Name Type Description Notes
exportedDatabase ExportedDatabase [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]