Jump to: navigation, search

Difference between revisions of "Trove/DBInstanceLogOperationV1"

(Get the list of all available database logging files per given datastore version)
(Create and save database logging file entry)
Line 95: Line 95:
  
 
'''Request'''
 
'''Request'''
 
 
{
 
{
  
Line 101: Line 100:
 
       "instance_id" : "12345678-1111-2222-3333-444444444444",
 
       "instance_id" : "12345678-1111-2222-3333-444444444444",
 
       "filename" : "general_log"
 
       "filename" : "general_log"
     }
+
     }}
 
 
}
 
  
  
 
'''Response'''
 
'''Response'''
 
 
{
 
{
 
 
     "dblog": {
 
     "dblog": {
 
       "instance_id" : "12345678-1111-2222-3333-444444444444",
 
       "instance_id" : "12345678-1111-2222-3333-444444444444",
 
       "file" : "mysql.log",
 
       "file" : "mysql.log",
 
       "location" : "http://somewhere.com/container/file"
 
       "location" : "http://somewhere.com/container/file"
     }
+
     }}
 
 
}
 
  
 
= Server-side configuration =
 
= Server-side configuration =

Revision as of 11:33, 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

Request

(No message body)

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"
                      }
   }}

Create and save database logging file entry

Request {

   "dblogs": {
     "instance_id" : "12345678-1111-2222-3333-444444444444",
     "filename" : "general_log"
   }}


Response {

   "dblog": {
     "instance_id" : "12345678-1111-2222-3333-444444444444",
     "file" : "mysql.log",
     "location" : "http://somewhere.com/container/file"
   }}

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