Jump to: navigation, search

Difference between revisions of "Trove/DBInstanceLogOperationV1"

(Mission)
(API Schema)
Line 7: Line 7:
  
 
= API Schema =
 
= API Schema =
 +
 +
=== API Details ===
 +
Three new resources, ''dblog-create'', "dblog-list'', "dblog-show" will be exposed as part of the Trove API.
 +
 +
The ''dblog-list" is used to provide an ability to list all available(availability defined by Trove) database logging filenames.
 +
 +
The ''dblog-show" is used to provide an ability to list all available(availability defined by Trove) database logging filenames per datastore version.
 +
 +
:    datastore_version_id – A system-defined UUID assigned to datastore vesrsion.
 +
 +
The ''dblog-create" is used to provide an ability to save database logging file into the Swift container.
 +
 +
To implement this capability, the create/modify/list instance operations will be extended in a manner that does not break the existing 1.0 contract.  These operations will permit a user to create a new database logging file entry for already existed instance, list all available database logging filenames for all registered datstore versions (basically, for all datastore managers across all versions), show all available database logging filenames per certain datastore version (manager).
  
 
=== DownloadDBLogFile request parameters and DBLog response object===
 
=== DownloadDBLogFile request parameters and DBLog response object===
Line 45: Line 58:
  
 
=== API Calls ===
 
=== API Calls ===
*List all available log files for user
+
==== Get the list of all available database logging files for all datastore versions====
  
'''GET'''  /{datastore_type}/logs
+
'''Response'''
<pre>
+
  {
{
+
    "dblogs": {
          name: server_log
+
                      {
          name: commit_log
+
                          "datastore_version_manager": "mysql",
          name: binary_log
+
                          "datastore_log_files": "general_log, log_slow_queries, log-error"
 +
                      },
 +
                      {
 +
                          "datastore_version_manager": "cassandra"
 +
                          "datastore_log_files": "system_log"
 +
                      },
 +
                      {
 +
                          "datastore_version_manager": "redis"
 +
                          "datastore_log_files": "system_log"
 +
                      },
 
}
 
}
</pre>
 
  
*Create log entry inside Swift container
+
==== Get the list of all available database logging files per given datastore version====
  
'''POST'''  /{instance_id}/{log_name}
+
'''Response'''
<pre>
+
  {
{
+
    "dblogs": {
          instance_id: {instance_id}
+
                      {
          filename_location: swift_url/{token}/{container_name}/"%s_%s" % ({instance_id}, {log_name})
+
                          "datastore_version_manager": "mysql",
 +
                          "datastore_log_files": "general_log, log_slow_queries, log-error"
 +
                      },
 
}
 
}
</pre>
 
  
 
= Server-side configuration =
 
= Server-side configuration =

Revision as of 11:17, 27 February 2014

Mission

Provide specific API interface to end-user which would allow to manipulate with database log files. This feature provides the ability to access log files via Swift so the can download them for Auditing/Troubleshooting purposes.

Design

Log manipulations are designed to let user perform log investigations. Since Trove is PaaS - level project, it's user cannot interact with compute instance directly, only with database through given API (database operations). Deployer would decide which log files would be available for trove user.

API Schema

API Details

Three new resources, dblog-create, "dblog-list, "dblog-show" will be exposed as part of the Trove API.

The dblog-list" is used to provide an ability to list all available(availability defined by Trove) database logging filenames.

The dblog-show" is used to provide an ability to list all available(availability defined by Trove) database logging filenames per datastore version.

datastore_version_id – A system-defined UUID assigned to datastore vesrsion.

The dblog-create" is used to provide an ability to save database logging file into the Swift container.

To implement this capability, the create/modify/list instance operations will be extended in a manner that does not break the existing 1.0 contract. These operations will permit a user to create a new database logging file entry for already existed instance, list all available database logging filenames for all registered datstore versions (basically, for all datastore managers across all versions), show all available database logging filenames per certain datastore version (manager).

DownloadDBLogFile request parameters and DBLog response object

Description: Downloads current database log file into Swift container.

Request Parameters:

Parameter name Description Type Required
Instance ID or Name The customer-assigned name of the DB instance that contains the log files. String Yes
LogFileName Log file name String Yes

Response Elements

Name Description Type Errors
LogFileData The following elements are returned in a structure named DBLog DBLog DBInstanceNotFound. HTTP 404

DBLog response object

DBLog is responsible for database log file stored in Swift container
Name Description Type
Instance ID instance UUID ID String
Filename in container Log file name String

API Calls

Get the list of all available database logging files for all datastore versions

Response

{
   "dblogs": {
                      {
                         "datastore_version_manager": "mysql",
                         "datastore_log_files": "general_log, log_slow_queries, log-error"
                      },
                      {
                         "datastore_version_manager": "cassandra"
                         "datastore_log_files": "system_log"
                      },
                      {
                         "datastore_version_manager": "redis"
                         "datastore_log_files": "system_log"
                      },

}

Get the list of all available database logging files per given datastore version

Response

{
   "dblogs": {
                      {
                         "datastore_version_manager": "mysql",
                         "datastore_log_files": "general_log, log_slow_queries, log-error"
                      },

}

Server-side configuration

  • Trove taskmanager and api services would require next conf values:
  1. list of available log files per datastore (could be retrieved from database configuration at guest side).

Guest-side configuration

  • Same as server side, guest side requires several configuration values:
  1. Mapping of log files names and their paths
  2. naming convention: {instance_id} + {path according to income filename} +daytime.log
  3. manifest convention: *.log or *tar.bz2 or *tar.gz
  4. Storage Strategy: Swift
  5. Container: logs_files