package NSrvKernel;


message TInitializeReload {
    message TGlobalArg {
        optional string Key = 1;
        optional string Value = 2;
    }
    optional string ConfigPath = 1;
    repeated TGlobalArg GlobalArgs = 2;
    optional uint64 CoroStackSize = 3;
    optional uint64 WorkerStartDelay = 4;
    optional bool SaveGlobals = 5;
}

message TShutdownMaster {
    enum EShutdownReason {
        RELOAD_CANCELED = 1;
        INITIALIZER_SIGTERM = 2;
    }

    optional EShutdownReason Reason = 1;
}

message TReloadState {
    enum EStatus {
        SUCCESS = 0;
        IN_PROGRESS = 1;
        FAILED = 2;
    }
    optional EStatus Status = 1;
    optional string Error = 2;
}

message TGetReloadState {
}

message TCancelReload {
}

message TOldMasterExited {
}

message TOldMasterClosedUnistat {
}

message THealthMessage {
}

message TInitializerMessage {
    oneof Message {
        TInitializeReload InitializeReload = 1;
        TShutdownMaster ShutdownMaster = 2;
        TReloadState ReloadState = 3;
        TGetReloadState GetReloadState = 4;
        TCancelReload CancelReload = 5;
        TOldMasterExited OldMasterExited = 6;
        TOldMasterClosedUnistat OldMasterClosedUnistat = 7;
        THealthMessage HealthMessage = 8;
    }
}
