syntax = "proto3";

package yandex.cloud.mdb.greenplum.v1;

import "google/protobuf/wrappers.proto";

import "yandex/cloud/validation.proto";


option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/greenplum/v1;greenplum";
option java_outer_classname = "GPCF";
option java_package = "yandex.cloud.api.mdb.greenplum.v1";


message Resources {
  // ID of the preset for computational resources available to a host (CPU, memory etc.).
  // All available presets are listed in the [documentation](/docs/managed-greenplum/concepts/instance-types).
  string resource_preset_id = 1;

  // Volume of the storage available to a host.
  int64 disk_size = 2;

  // Type of the storage environment for the host.
  //
  // Possible values:
  // * network-hdd - network HDD drive,
  // * network-ssd - network SSD drive,
  // * local-ssd - local SSD storage.
  string disk_type_id = 3;
}

// Configuration of master subcluster
message MasterSubclusterConfig {
  // Resources allocated to Greenplum master subcluster hosts.
  Resources resources = 1;

  // Configuration settings of a Greenplum master server.
  GreenplumMasterConfigSet config = 2;
}

// Configuration of segmet subcluster
message SegmentSubclusterConfig {
  // Resources allocated to Greenplum segment subcluster hosts.
  Resources resources = 1; 

  // Configuration settings of a Greenplum segment server.
  GreenplumSegmentConfigSet config = 2;
}


// Greenplum master subcluster configuration options. Detailed description for each set of options
//
// Any options not listed here are not supported.
message GreenplumMasterConfig {
  enum LogLevel {
    LOG_LEVEL_UNSPECIFIED = 0;
  
    TRACE = 1;
  
    DEBUG = 2;
  
    INFORMATION = 3;
  
    WARNING = 4;
  
    ERROR = 5;
  }
  
  // Logging level for the Greenplum master subcluster. Possible values: TRACE, DEBUG, INFORMATION, WARNING, ERROR.
  LogLevel log_level = 1;
  
  // Maximum number of inbound connections.
  google.protobuf.Int64Value max_connections = 2;
  
  // The server's time zone to be used in DateTime fields conversions. Specified as an IANA identifier.
  google.protobuf.StringValue timezone = 3;
  
}


// Greenplum segment subcluster configuration options. Detailed description for each set of options
//
// Any options not listed here are not supported.
message GreenplumSegmentConfig {
  enum LogLevel {
    LOG_LEVEL_UNSPECIFIED = 0;
  
    TRACE = 1;
  
    DEBUG = 2;
  
    INFORMATION = 3;
  
    WARNING = 4;
  
    ERROR = 5;
  }
  
  // Logging level for the Greenplum segment subcluster. Possible values: TRACE, DEBUG, INFORMATION, WARNING, ERROR.
  LogLevel log_level = 1;
  
  // Maximum number of inbound connections.
  google.protobuf.Int64Value max_connections = 2;
}

message GreenplumMasterConfigSet {
  // Effective settings for a Greenplum master subcluster (a combination of settings defined
  // in [user_config] and [default_config]).
  GreenplumMasterConfig effective_config = 1 [(required) = true];

  // User-defined settings for a Greenplum master subcluster.
  GreenplumMasterConfig user_config = 2;

  // Default configuration for a Greenplum master subcluster.
  GreenplumMasterConfig default_config = 3;
}

message GreenplumSegmentConfigSet {
  // Effective settings for a Greenplum segment subcluster (a combination of settings defined
  // in [user_config] and [default_config]).
  GreenplumSegmentConfig effective_config = 1 [(required) = true];

  // User-defined settings for a Greenplum segment subcluster.
  GreenplumSegmentConfig user_config = 2;

  // Default configuration for a Greenplum segment subcluster.
  GreenplumSegmentConfig default_config = 3;
}
