#include "get_dc.h"
#include <saas/deploy_manager/server/client/client.h>
#include <saas/util/external/dc.h>

namespace NRTYDeploy {
    bool TScriptGetDC::Process(IDeployInfoRequest& request) {
        const TString& slot = request.GetRD().CgiParam.Get("slot");
        const TString dcName = TDatacenterUtil::Instance().GetDatacenter(slot);
        request.Output() << "HTTP/1.1 200 \r\n\r\n";
        request.Output() << dcName;
        return true;
    }
    IScript::TFactory::TRegistrator<TScriptGetDC> TScriptGetDC::Registrator("get_dc");
}
