diff --git a/VERSION b/VERSION
index 27f9cd3..f8e233b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.8.0
+1.9.0
diff --git a/cpp/dmi/sw_management_service.grpc.pb.cc b/cpp/dmi/sw_management_service.grpc.pb.cc
index 975b684..0aab698 100644
--- a/cpp/dmi/sw_management_service.grpc.pb.cc
+++ b/cpp/dmi/sw_management_service.grpc.pb.cc
@@ -28,6 +28,7 @@
   "/dmi.NativeSoftwareManagementService/RevertToStandbyImage",
   "/dmi.NativeSoftwareManagementService/UpdateStartupConfiguration",
   "/dmi.NativeSoftwareManagementService/GetStartupConfigurationInfo",
+  "/dmi.NativeSoftwareManagementService/UploadDebugInfo",
 };
 
 std::unique_ptr< NativeSoftwareManagementService::Stub> NativeSoftwareManagementService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
@@ -43,6 +44,7 @@
   , rpcmethod_RevertToStandbyImage_(NativeSoftwareManagementService_method_names[3], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
   , rpcmethod_UpdateStartupConfiguration_(NativeSoftwareManagementService_method_names[4], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
   , rpcmethod_GetStartupConfigurationInfo_(NativeSoftwareManagementService_method_names[5], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
+  , rpcmethod_UploadDebugInfo_(NativeSoftwareManagementService_method_names[6], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
   {}
 
 ::grpc::Status NativeSoftwareManagementService::Stub::GetSoftwareVersion(::grpc::ClientContext* context, const ::dmi::HardwareID& request, ::dmi::GetSoftwareVersionInformationResponse* response) {
@@ -165,6 +167,22 @@
   return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::dmi::StartupConfigInfoResponse>::Create(channel_.get(), cq, rpcmethod_GetStartupConfigurationInfo_, context, request, false);
 }
 
+::grpc::ClientReader< ::dmi::UploadDebugInfoStatus>* NativeSoftwareManagementService::Stub::UploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request) {
+  return ::grpc_impl::internal::ClientReaderFactory< ::dmi::UploadDebugInfoStatus>::Create(channel_.get(), rpcmethod_UploadDebugInfo_, context, request);
+}
+
+void NativeSoftwareManagementService::Stub::experimental_async::UploadDebugInfo(::grpc::ClientContext* context, ::dmi::UploadDebugInfoRequest* request, ::grpc::experimental::ClientReadReactor< ::dmi::UploadDebugInfoStatus>* reactor) {
+  ::grpc_impl::internal::ClientCallbackReaderFactory< ::dmi::UploadDebugInfoStatus>::Create(stub_->channel_.get(), stub_->rpcmethod_UploadDebugInfo_, context, request, reactor);
+}
+
+::grpc::ClientAsyncReader< ::dmi::UploadDebugInfoStatus>* NativeSoftwareManagementService::Stub::AsyncUploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
+  return ::grpc_impl::internal::ClientAsyncReaderFactory< ::dmi::UploadDebugInfoStatus>::Create(channel_.get(), cq, rpcmethod_UploadDebugInfo_, context, request, true, tag);
+}
+
+::grpc::ClientAsyncReader< ::dmi::UploadDebugInfoStatus>* NativeSoftwareManagementService::Stub::PrepareAsyncUploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq) {
+  return ::grpc_impl::internal::ClientAsyncReaderFactory< ::dmi::UploadDebugInfoStatus>::Create(channel_.get(), cq, rpcmethod_UploadDebugInfo_, context, request, false, nullptr);
+}
+
 NativeSoftwareManagementService::Service::Service() {
   AddMethod(new ::grpc::internal::RpcServiceMethod(
       NativeSoftwareManagementService_method_names[0],
@@ -226,6 +244,16 @@
              ::dmi::StartupConfigInfoResponse* resp) {
                return service->GetStartupConfigurationInfo(ctx, req, resp);
              }, this)));
+  AddMethod(new ::grpc::internal::RpcServiceMethod(
+      NativeSoftwareManagementService_method_names[6],
+      ::grpc::internal::RpcMethod::SERVER_STREAMING,
+      new ::grpc::internal::ServerStreamingHandler< NativeSoftwareManagementService::Service, ::dmi::UploadDebugInfoRequest, ::dmi::UploadDebugInfoStatus>(
+          [](NativeSoftwareManagementService::Service* service,
+             ::grpc_impl::ServerContext* ctx,
+             const ::dmi::UploadDebugInfoRequest* req,
+             ::grpc_impl::ServerWriter<::dmi::UploadDebugInfoStatus>* writer) {
+               return service->UploadDebugInfo(ctx, req, writer);
+             }, this)));
 }
 
 NativeSoftwareManagementService::Service::~Service() {
@@ -273,6 +301,13 @@
   return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
 }
 
+::grpc::Status NativeSoftwareManagementService::Service::UploadDebugInfo(::grpc::ServerContext* context, const ::dmi::UploadDebugInfoRequest* request, ::grpc::ServerWriter< ::dmi::UploadDebugInfoStatus>* writer) {
+  (void) context;
+  (void) request;
+  (void) writer;
+  return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+}
+
 
 }  // namespace dmi
 
diff --git a/cpp/dmi/sw_management_service.grpc.pb.h b/cpp/dmi/sw_management_service.grpc.pb.h
index 870e714..943da9f 100644
--- a/cpp/dmi/sw_management_service.grpc.pb.h
+++ b/cpp/dmi/sw_management_service.grpc.pb.h
@@ -95,6 +95,16 @@
     std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::StartupConfigInfoResponse>> PrepareAsyncGetStartupConfigurationInfo(::grpc::ClientContext* context, const ::dmi::StartupConfigInfoRequest& request, ::grpc::CompletionQueue* cq) {
       return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::dmi::StartupConfigInfoResponse>>(PrepareAsyncGetStartupConfigurationInfoRaw(context, request, cq));
     }
+    // This API can be used to upload to a remote location, information useful for troubleshooting problems on the hardware
+    std::unique_ptr< ::grpc::ClientReaderInterface< ::dmi::UploadDebugInfoStatus>> UploadDebugInfo(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request) {
+      return std::unique_ptr< ::grpc::ClientReaderInterface< ::dmi::UploadDebugInfoStatus>>(UploadDebugInfoRaw(context, request));
+    }
+    std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::dmi::UploadDebugInfoStatus>> AsyncUploadDebugInfo(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
+      return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::dmi::UploadDebugInfoStatus>>(AsyncUploadDebugInfoRaw(context, request, cq, tag));
+    }
+    std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::dmi::UploadDebugInfoStatus>> PrepareAsyncUploadDebugInfo(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::dmi::UploadDebugInfoStatus>>(PrepareAsyncUploadDebugInfoRaw(context, request, cq));
+    }
     class experimental_async_interface {
      public:
       virtual ~experimental_async_interface() {}
@@ -151,6 +161,12 @@
       #else
       virtual void GetStartupConfigurationInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::StartupConfigInfoResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0;
       #endif
+      // This API can be used to upload to a remote location, information useful for troubleshooting problems on the hardware
+      #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      virtual void UploadDebugInfo(::grpc::ClientContext* context, ::dmi::UploadDebugInfoRequest* request, ::grpc::ClientReadReactor< ::dmi::UploadDebugInfoStatus>* reactor) = 0;
+      #else
+      virtual void UploadDebugInfo(::grpc::ClientContext* context, ::dmi::UploadDebugInfoRequest* request, ::grpc::experimental::ClientReadReactor< ::dmi::UploadDebugInfoStatus>* reactor) = 0;
+      #endif
     };
     #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
     typedef class experimental_async_interface async_interface;
@@ -176,6 +192,9 @@
     virtual ::grpc::ClientAsyncReaderInterface< ::dmi::ConfigResponse>* PrepareAsyncUpdateStartupConfigurationRaw(::grpc::ClientContext* context, const ::dmi::ConfigRequest& request, ::grpc::CompletionQueue* cq) = 0;
     virtual ::grpc::ClientAsyncResponseReaderInterface< ::dmi::StartupConfigInfoResponse>* AsyncGetStartupConfigurationInfoRaw(::grpc::ClientContext* context, const ::dmi::StartupConfigInfoRequest& request, ::grpc::CompletionQueue* cq) = 0;
     virtual ::grpc::ClientAsyncResponseReaderInterface< ::dmi::StartupConfigInfoResponse>* PrepareAsyncGetStartupConfigurationInfoRaw(::grpc::ClientContext* context, const ::dmi::StartupConfigInfoRequest& request, ::grpc::CompletionQueue* cq) = 0;
+    virtual ::grpc::ClientReaderInterface< ::dmi::UploadDebugInfoStatus>* UploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request) = 0;
+    virtual ::grpc::ClientAsyncReaderInterface< ::dmi::UploadDebugInfoStatus>* AsyncUploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq, void* tag) = 0;
+    virtual ::grpc::ClientAsyncReaderInterface< ::dmi::UploadDebugInfoStatus>* PrepareAsyncUploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq) = 0;
   };
   class Stub final : public StubInterface {
    public:
@@ -230,6 +249,15 @@
     std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::StartupConfigInfoResponse>> PrepareAsyncGetStartupConfigurationInfo(::grpc::ClientContext* context, const ::dmi::StartupConfigInfoRequest& request, ::grpc::CompletionQueue* cq) {
       return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::dmi::StartupConfigInfoResponse>>(PrepareAsyncGetStartupConfigurationInfoRaw(context, request, cq));
     }
+    std::unique_ptr< ::grpc::ClientReader< ::dmi::UploadDebugInfoStatus>> UploadDebugInfo(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request) {
+      return std::unique_ptr< ::grpc::ClientReader< ::dmi::UploadDebugInfoStatus>>(UploadDebugInfoRaw(context, request));
+    }
+    std::unique_ptr< ::grpc::ClientAsyncReader< ::dmi::UploadDebugInfoStatus>> AsyncUploadDebugInfo(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
+      return std::unique_ptr< ::grpc::ClientAsyncReader< ::dmi::UploadDebugInfoStatus>>(AsyncUploadDebugInfoRaw(context, request, cq, tag));
+    }
+    std::unique_ptr< ::grpc::ClientAsyncReader< ::dmi::UploadDebugInfoStatus>> PrepareAsyncUploadDebugInfo(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncReader< ::dmi::UploadDebugInfoStatus>>(PrepareAsyncUploadDebugInfoRaw(context, request, cq));
+    }
     class experimental_async final :
       public StubInterface::experimental_async_interface {
      public:
@@ -277,6 +305,11 @@
       #else
       void GetStartupConfigurationInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::dmi::StartupConfigInfoResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override;
       #endif
+      #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      void UploadDebugInfo(::grpc::ClientContext* context, ::dmi::UploadDebugInfoRequest* request, ::grpc::ClientReadReactor< ::dmi::UploadDebugInfoStatus>* reactor) override;
+      #else
+      void UploadDebugInfo(::grpc::ClientContext* context, ::dmi::UploadDebugInfoRequest* request, ::grpc::experimental::ClientReadReactor< ::dmi::UploadDebugInfoStatus>* reactor) override;
+      #endif
      private:
       friend class Stub;
       explicit experimental_async(Stub* stub): stub_(stub) { }
@@ -304,12 +337,16 @@
     ::grpc::ClientAsyncReader< ::dmi::ConfigResponse>* PrepareAsyncUpdateStartupConfigurationRaw(::grpc::ClientContext* context, const ::dmi::ConfigRequest& request, ::grpc::CompletionQueue* cq) override;
     ::grpc::ClientAsyncResponseReader< ::dmi::StartupConfigInfoResponse>* AsyncGetStartupConfigurationInfoRaw(::grpc::ClientContext* context, const ::dmi::StartupConfigInfoRequest& request, ::grpc::CompletionQueue* cq) override;
     ::grpc::ClientAsyncResponseReader< ::dmi::StartupConfigInfoResponse>* PrepareAsyncGetStartupConfigurationInfoRaw(::grpc::ClientContext* context, const ::dmi::StartupConfigInfoRequest& request, ::grpc::CompletionQueue* cq) override;
+    ::grpc::ClientReader< ::dmi::UploadDebugInfoStatus>* UploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request) override;
+    ::grpc::ClientAsyncReader< ::dmi::UploadDebugInfoStatus>* AsyncUploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq, void* tag) override;
+    ::grpc::ClientAsyncReader< ::dmi::UploadDebugInfoStatus>* PrepareAsyncUploadDebugInfoRaw(::grpc::ClientContext* context, const ::dmi::UploadDebugInfoRequest& request, ::grpc::CompletionQueue* cq) override;
     const ::grpc::internal::RpcMethod rpcmethod_GetSoftwareVersion_;
     const ::grpc::internal::RpcMethod rpcmethod_DownloadImage_;
     const ::grpc::internal::RpcMethod rpcmethod_ActivateImage_;
     const ::grpc::internal::RpcMethod rpcmethod_RevertToStandbyImage_;
     const ::grpc::internal::RpcMethod rpcmethod_UpdateStartupConfiguration_;
     const ::grpc::internal::RpcMethod rpcmethod_GetStartupConfigurationInfo_;
+    const ::grpc::internal::RpcMethod rpcmethod_UploadDebugInfo_;
   };
   static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
 
@@ -332,6 +369,8 @@
     virtual ::grpc::Status UpdateStartupConfiguration(::grpc::ServerContext* context, const ::dmi::ConfigRequest* request, ::grpc::ServerWriter< ::dmi::ConfigResponse>* writer);
     // This API can be used to retrieve information about the current startup configuration that a device is using
     virtual ::grpc::Status GetStartupConfigurationInfo(::grpc::ServerContext* context, const ::dmi::StartupConfigInfoRequest* request, ::dmi::StartupConfigInfoResponse* response);
+    // This API can be used to upload to a remote location, information useful for troubleshooting problems on the hardware
+    virtual ::grpc::Status UploadDebugInfo(::grpc::ServerContext* context, const ::dmi::UploadDebugInfoRequest* request, ::grpc::ServerWriter< ::dmi::UploadDebugInfoStatus>* writer);
   };
   template <class BaseClass>
   class WithAsyncMethod_GetSoftwareVersion : public BaseClass {
@@ -453,7 +492,27 @@
       ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag);
     }
   };
-  typedef WithAsyncMethod_GetSoftwareVersion<WithAsyncMethod_DownloadImage<WithAsyncMethod_ActivateImage<WithAsyncMethod_RevertToStandbyImage<WithAsyncMethod_UpdateStartupConfiguration<WithAsyncMethod_GetStartupConfigurationInfo<Service > > > > > > AsyncService;
+  template <class BaseClass>
+  class WithAsyncMethod_UploadDebugInfo : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithAsyncMethod_UploadDebugInfo() {
+      ::grpc::Service::MarkMethodAsync(6);
+    }
+    ~WithAsyncMethod_UploadDebugInfo() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status UploadDebugInfo(::grpc::ServerContext* /*context*/, const ::dmi::UploadDebugInfoRequest* /*request*/, ::grpc::ServerWriter< ::dmi::UploadDebugInfoStatus>* /*writer*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    void RequestUploadDebugInfo(::grpc::ServerContext* context, ::dmi::UploadDebugInfoRequest* request, ::grpc::ServerAsyncWriter< ::dmi::UploadDebugInfoStatus>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+      ::grpc::Service::RequestAsyncServerStreaming(6, context, request, writer, new_call_cq, notification_cq, tag);
+    }
+  };
+  typedef WithAsyncMethod_GetSoftwareVersion<WithAsyncMethod_DownloadImage<WithAsyncMethod_ActivateImage<WithAsyncMethod_RevertToStandbyImage<WithAsyncMethod_UpdateStartupConfiguration<WithAsyncMethod_GetStartupConfigurationInfo<WithAsyncMethod_UploadDebugInfo<Service > > > > > > > AsyncService;
   template <class BaseClass>
   class ExperimentalWithCallbackMethod_GetSoftwareVersion : public BaseClass {
    private:
@@ -700,11 +759,49 @@
     #endif
       { return nullptr; }
   };
+  template <class BaseClass>
+  class ExperimentalWithCallbackMethod_UploadDebugInfo : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    ExperimentalWithCallbackMethod_UploadDebugInfo() {
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      ::grpc::Service::
+    #else
+      ::grpc::Service::experimental().
+    #endif
+        MarkMethodCallback(6,
+          new ::grpc_impl::internal::CallbackServerStreamingHandler< ::dmi::UploadDebugInfoRequest, ::dmi::UploadDebugInfoStatus>(
+            [this](
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+                   ::grpc::CallbackServerContext*
+    #else
+                   ::grpc::experimental::CallbackServerContext*
+    #endif
+                     context, const ::dmi::UploadDebugInfoRequest* request) { return this->UploadDebugInfo(context, request); }));
+    }
+    ~ExperimentalWithCallbackMethod_UploadDebugInfo() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status UploadDebugInfo(::grpc::ServerContext* /*context*/, const ::dmi::UploadDebugInfoRequest* /*request*/, ::grpc::ServerWriter< ::dmi::UploadDebugInfoStatus>* /*writer*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+    virtual ::grpc::ServerWriteReactor< ::dmi::UploadDebugInfoStatus>* UploadDebugInfo(
+      ::grpc::CallbackServerContext* /*context*/, const ::dmi::UploadDebugInfoRequest* /*request*/)
+    #else
+    virtual ::grpc::experimental::ServerWriteReactor< ::dmi::UploadDebugInfoStatus>* UploadDebugInfo(
+      ::grpc::experimental::CallbackServerContext* /*context*/, const ::dmi::UploadDebugInfoRequest* /*request*/)
+    #endif
+      { return nullptr; }
+  };
   #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
-  typedef ExperimentalWithCallbackMethod_GetSoftwareVersion<ExperimentalWithCallbackMethod_DownloadImage<ExperimentalWithCallbackMethod_ActivateImage<ExperimentalWithCallbackMethod_RevertToStandbyImage<ExperimentalWithCallbackMethod_UpdateStartupConfiguration<ExperimentalWithCallbackMethod_GetStartupConfigurationInfo<Service > > > > > > CallbackService;
+  typedef ExperimentalWithCallbackMethod_GetSoftwareVersion<ExperimentalWithCallbackMethod_DownloadImage<ExperimentalWithCallbackMethod_ActivateImage<ExperimentalWithCallbackMethod_RevertToStandbyImage<ExperimentalWithCallbackMethod_UpdateStartupConfiguration<ExperimentalWithCallbackMethod_GetStartupConfigurationInfo<ExperimentalWithCallbackMethod_UploadDebugInfo<Service > > > > > > > CallbackService;
   #endif
 
-  typedef ExperimentalWithCallbackMethod_GetSoftwareVersion<ExperimentalWithCallbackMethod_DownloadImage<ExperimentalWithCallbackMethod_ActivateImage<ExperimentalWithCallbackMethod_RevertToStandbyImage<ExperimentalWithCallbackMethod_UpdateStartupConfiguration<ExperimentalWithCallbackMethod_GetStartupConfigurationInfo<Service > > > > > > ExperimentalCallbackService;
+  typedef ExperimentalWithCallbackMethod_GetSoftwareVersion<ExperimentalWithCallbackMethod_DownloadImage<ExperimentalWithCallbackMethod_ActivateImage<ExperimentalWithCallbackMethod_RevertToStandbyImage<ExperimentalWithCallbackMethod_UpdateStartupConfiguration<ExperimentalWithCallbackMethod_GetStartupConfigurationInfo<ExperimentalWithCallbackMethod_UploadDebugInfo<Service > > > > > > > ExperimentalCallbackService;
   template <class BaseClass>
   class WithGenericMethod_GetSoftwareVersion : public BaseClass {
    private:
@@ -808,6 +905,23 @@
     }
   };
   template <class BaseClass>
+  class WithGenericMethod_UploadDebugInfo : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithGenericMethod_UploadDebugInfo() {
+      ::grpc::Service::MarkMethodGeneric(6);
+    }
+    ~WithGenericMethod_UploadDebugInfo() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status UploadDebugInfo(::grpc::ServerContext* /*context*/, const ::dmi::UploadDebugInfoRequest* /*request*/, ::grpc::ServerWriter< ::dmi::UploadDebugInfoStatus>* /*writer*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+  };
+  template <class BaseClass>
   class WithRawMethod_GetSoftwareVersion : public BaseClass {
    private:
     void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -928,6 +1042,26 @@
     }
   };
   template <class BaseClass>
+  class WithRawMethod_UploadDebugInfo : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithRawMethod_UploadDebugInfo() {
+      ::grpc::Service::MarkMethodRaw(6);
+    }
+    ~WithRawMethod_UploadDebugInfo() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status UploadDebugInfo(::grpc::ServerContext* /*context*/, const ::dmi::UploadDebugInfoRequest* /*request*/, ::grpc::ServerWriter< ::dmi::UploadDebugInfoStatus>* /*writer*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    void RequestUploadDebugInfo(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+      ::grpc::Service::RequestAsyncServerStreaming(6, context, request, writer, new_call_cq, notification_cq, tag);
+    }
+  };
+  template <class BaseClass>
   class ExperimentalWithRawCallbackMethod_GetSoftwareVersion : public BaseClass {
    private:
     void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -1156,6 +1290,44 @@
       { return nullptr; }
   };
   template <class BaseClass>
+  class ExperimentalWithRawCallbackMethod_UploadDebugInfo : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    ExperimentalWithRawCallbackMethod_UploadDebugInfo() {
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      ::grpc::Service::
+    #else
+      ::grpc::Service::experimental().
+    #endif
+        MarkMethodRawCallback(6,
+          new ::grpc_impl::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
+            [this](
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+                   ::grpc::CallbackServerContext*
+    #else
+                   ::grpc::experimental::CallbackServerContext*
+    #endif
+                     context, const::grpc::ByteBuffer* request) { return this->UploadDebugInfo(context, request); }));
+    }
+    ~ExperimentalWithRawCallbackMethod_UploadDebugInfo() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status UploadDebugInfo(::grpc::ServerContext* /*context*/, const ::dmi::UploadDebugInfoRequest* /*request*/, ::grpc::ServerWriter< ::dmi::UploadDebugInfoStatus>* /*writer*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+    virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* UploadDebugInfo(
+      ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/)
+    #else
+    virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* UploadDebugInfo(
+      ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/)
+    #endif
+      { return nullptr; }
+  };
+  template <class BaseClass>
   class WithStreamedUnaryMethod_GetSoftwareVersion : public BaseClass {
    private:
     void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -1318,8 +1490,35 @@
     // replace default version of method with split streamed
     virtual ::grpc::Status StreamedUpdateStartupConfiguration(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::dmi::ConfigRequest,::dmi::ConfigResponse>* server_split_streamer) = 0;
   };
-  typedef WithSplitStreamingMethod_DownloadImage<WithSplitStreamingMethod_ActivateImage<WithSplitStreamingMethod_RevertToStandbyImage<WithSplitStreamingMethod_UpdateStartupConfiguration<Service > > > > SplitStreamedService;
-  typedef WithStreamedUnaryMethod_GetSoftwareVersion<WithSplitStreamingMethod_DownloadImage<WithSplitStreamingMethod_ActivateImage<WithSplitStreamingMethod_RevertToStandbyImage<WithSplitStreamingMethod_UpdateStartupConfiguration<WithStreamedUnaryMethod_GetStartupConfigurationInfo<Service > > > > > > StreamedService;
+  template <class BaseClass>
+  class WithSplitStreamingMethod_UploadDebugInfo : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithSplitStreamingMethod_UploadDebugInfo() {
+      ::grpc::Service::MarkMethodStreamed(6,
+        new ::grpc::internal::SplitServerStreamingHandler<
+          ::dmi::UploadDebugInfoRequest, ::dmi::UploadDebugInfoStatus>(
+            [this](::grpc_impl::ServerContext* context,
+                   ::grpc_impl::ServerSplitStreamer<
+                     ::dmi::UploadDebugInfoRequest, ::dmi::UploadDebugInfoStatus>* streamer) {
+                       return this->StreamedUploadDebugInfo(context,
+                         streamer);
+                  }));
+    }
+    ~WithSplitStreamingMethod_UploadDebugInfo() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable regular version of this method
+    ::grpc::Status UploadDebugInfo(::grpc::ServerContext* /*context*/, const ::dmi::UploadDebugInfoRequest* /*request*/, ::grpc::ServerWriter< ::dmi::UploadDebugInfoStatus>* /*writer*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    // replace default version of method with split streamed
+    virtual ::grpc::Status StreamedUploadDebugInfo(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::dmi::UploadDebugInfoRequest,::dmi::UploadDebugInfoStatus>* server_split_streamer) = 0;
+  };
+  typedef WithSplitStreamingMethod_DownloadImage<WithSplitStreamingMethod_ActivateImage<WithSplitStreamingMethod_RevertToStandbyImage<WithSplitStreamingMethod_UpdateStartupConfiguration<WithSplitStreamingMethod_UploadDebugInfo<Service > > > > > SplitStreamedService;
+  typedef WithStreamedUnaryMethod_GetSoftwareVersion<WithSplitStreamingMethod_DownloadImage<WithSplitStreamingMethod_ActivateImage<WithSplitStreamingMethod_RevertToStandbyImage<WithSplitStreamingMethod_UpdateStartupConfiguration<WithStreamedUnaryMethod_GetStartupConfigurationInfo<WithSplitStreamingMethod_UploadDebugInfo<Service > > > > > > > StreamedService;
 };
 
 }  // namespace dmi
diff --git a/cpp/dmi/sw_management_service.pb.cc b/cpp/dmi/sw_management_service.pb.cc
index 508dd63..1fc0e00 100644
--- a/cpp/dmi/sw_management_service.pb.cc
+++ b/cpp/dmi/sw_management_service.pb.cc
@@ -49,6 +49,14 @@
  public:
   ::google::protobuf::internal::ExplicitlyConstructed<StartupConfigInfoResponse> _instance;
 } _StartupConfigInfoResponse_default_instance_;
+class UploadDebugInfoRequestDefaultTypeInternal {
+ public:
+  ::google::protobuf::internal::ExplicitlyConstructed<UploadDebugInfoRequest> _instance;
+} _UploadDebugInfoRequest_default_instance_;
+class UploadDebugInfoStatusDefaultTypeInternal {
+ public:
+  ::google::protobuf::internal::ExplicitlyConstructed<UploadDebugInfoStatus> _instance;
+} _UploadDebugInfoStatus_default_instance_;
 }  // namespace dmi
 static void InitDefaultsSoftwareVersionInformation_dmi_2fsw_5fmanagement_5fservice_2eproto() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
@@ -154,6 +162,36 @@
 ::google::protobuf::internal::SCCInfo<0> scc_info_StartupConfigInfoResponse_dmi_2fsw_5fmanagement_5fservice_2eproto =
     {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsStartupConfigInfoResponse_dmi_2fsw_5fmanagement_5fservice_2eproto}, {}};
 
+static void InitDefaultsUploadDebugInfoRequest_dmi_2fsw_5fmanagement_5fservice_2eproto() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  {
+    void* ptr = &::dmi::_UploadDebugInfoRequest_default_instance_;
+    new (ptr) ::dmi::UploadDebugInfoRequest();
+    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::dmi::UploadDebugInfoRequest::InitAsDefaultInstance();
+}
+
+::google::protobuf::internal::SCCInfo<1> scc_info_UploadDebugInfoRequest_dmi_2fsw_5fmanagement_5fservice_2eproto =
+    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsUploadDebugInfoRequest_dmi_2fsw_5fmanagement_5fservice_2eproto}, {
+      &scc_info_Uuid_dmi_2fhw_2eproto.base,}};
+
+static void InitDefaultsUploadDebugInfoStatus_dmi_2fsw_5fmanagement_5fservice_2eproto() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  {
+    void* ptr = &::dmi::_UploadDebugInfoStatus_default_instance_;
+    new (ptr) ::dmi::UploadDebugInfoStatus();
+    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::dmi::UploadDebugInfoStatus::InitAsDefaultInstance();
+}
+
+::google::protobuf::internal::SCCInfo<1> scc_info_UploadDebugInfoStatus_dmi_2fsw_5fmanagement_5fservice_2eproto =
+    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsUploadDebugInfoStatus_dmi_2fsw_5fmanagement_5fservice_2eproto}, {
+      &scc_info_Uuid_dmi_2fhw_2eproto.base,}};
+
 void InitDefaults_dmi_2fsw_5fmanagement_5fservice_2eproto() {
   ::google::protobuf::internal::InitSCC(&scc_info_SoftwareVersionInformation_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
   ::google::protobuf::internal::InitSCC(&scc_info_GetSoftwareVersionInformationResponse_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
@@ -162,10 +200,12 @@
   ::google::protobuf::internal::InitSCC(&scc_info_ConfigResponse_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
   ::google::protobuf::internal::InitSCC(&scc_info_StartupConfigInfoRequest_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
   ::google::protobuf::internal::InitSCC(&scc_info_StartupConfigInfoResponse_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
+  ::google::protobuf::internal::InitSCC(&scc_info_UploadDebugInfoRequest_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
+  ::google::protobuf::internal::InitSCC(&scc_info_UploadDebugInfoStatus_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
 }
 
-::google::protobuf::Metadata file_level_metadata_dmi_2fsw_5fmanagement_5fservice_2eproto[7];
-const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto[3];
+::google::protobuf::Metadata file_level_metadata_dmi_2fsw_5fmanagement_5fservice_2eproto[9];
+const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto[5];
 constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto = nullptr;
 
 const ::google::protobuf::uint32 TableStruct_dmi_2fsw_5fmanagement_5fservice_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
@@ -223,6 +263,24 @@
   PROTOBUF_FIELD_OFFSET(::dmi::StartupConfigInfoResponse, config_url_),
   PROTOBUF_FIELD_OFFSET(::dmi::StartupConfigInfoResponse, version_),
   PROTOBUF_FIELD_OFFSET(::dmi::StartupConfigInfoResponse, reason_detail_),
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoRequest, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoRequest, device_uuid_),
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoRequest, location_url_),
+  ~0u,  // no _has_bits_
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoStatus, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoStatus, device_uuid_),
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoStatus, status_),
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoStatus, percent_uploaded_),
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoStatus, reason_),
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoStatus, location_url_),
+  PROTOBUF_FIELD_OFFSET(::dmi::UploadDebugInfoStatus, file_name_),
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   { 0, -1, sizeof(::dmi::SoftwareVersionInformation)},
@@ -232,6 +290,8 @@
   { 30, -1, sizeof(::dmi::ConfigResponse)},
   { 38, -1, sizeof(::dmi::StartupConfigInfoRequest)},
   { 44, -1, sizeof(::dmi::StartupConfigInfoResponse)},
+  { 54, -1, sizeof(::dmi::UploadDebugInfoRequest)},
+  { 61, -1, sizeof(::dmi::UploadDebugInfoStatus)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -242,12 +302,14 @@
   reinterpret_cast<const ::google::protobuf::Message*>(&::dmi::_ConfigResponse_default_instance_),
   reinterpret_cast<const ::google::protobuf::Message*>(&::dmi::_StartupConfigInfoRequest_default_instance_),
   reinterpret_cast<const ::google::protobuf::Message*>(&::dmi::_StartupConfigInfoResponse_default_instance_),
+  reinterpret_cast<const ::google::protobuf::Message*>(&::dmi::_UploadDebugInfoRequest_default_instance_),
+  reinterpret_cast<const ::google::protobuf::Message*>(&::dmi::_UploadDebugInfoStatus_default_instance_),
 };
 
 ::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_dmi_2fsw_5fmanagement_5fservice_2eproto = {
   {}, AddDescriptors_dmi_2fsw_5fmanagement_5fservice_2eproto, "dmi/sw_management_service.proto", schemas,
   file_default_instances, TableStruct_dmi_2fsw_5fmanagement_5fservice_2eproto::offsets,
-  file_level_metadata_dmi_2fsw_5fmanagement_5fservice_2eproto, 7, file_level_enum_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto, file_level_service_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto,
+  file_level_metadata_dmi_2fsw_5fmanagement_5fservice_2eproto, 9, file_level_enum_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto, file_level_service_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto,
 };
 
 const char descriptor_table_protodef_dmi_2fsw_5fmanagement_5fservice_2eproto[] =
@@ -283,25 +345,42 @@
   "_url\030\003 \001(\t\022\017\n\007version\030\004 \001(\t\022\025\n\rreason_de"
   "tail\030\005 \001(\t\"^\n\006Reason\022\024\n\020UNDEFINED_REASON"
   "\020\000\022\022\n\016UNKNOWN_DEVICE\020\001\022\022\n\016INTERNAL_ERROR"
-  "\020\002\022\026\n\022DEVICE_UNREACHABLE\020\0032\316\003\n\037NativeSof"
-  "twareManagementService\022Q\n\022GetSoftwareVer"
-  "sion\022\017.dmi.HardwareID\032*.dmi.GetSoftwareV"
-  "ersionInformationResponse\022>\n\rDownloadIma"
-  "ge\022\031.dmi.DownloadImageRequest\032\020.dmi.Imag"
-  "eStatus0\001\0224\n\rActivateImage\022\017.dmi.Hardwar"
-  "eID\032\020.dmi.ImageStatus0\001\022;\n\024RevertToStand"
-  "byImage\022\017.dmi.HardwareID\032\020.dmi.ImageStat"
-  "us0\001\022G\n\032UpdateStartupConfiguration\022\022.dmi"
-  ".ConfigRequest\032\023.dmi.ConfigResponse0\001\022\\\n"
-  "\033GetStartupConfigurationInfo\022\035.dmi.Start"
-  "upConfigInfoRequest\032\036.dmi.StartupConfigI"
-  "nfoResponseB;Z9github.com/opencord/devic"
-  "e-management-interface/v3/go/dmib\006proto3"
+  "\020\002\022\026\n\022DEVICE_UNREACHABLE\020\003\"N\n\026UploadDebu"
+  "gInfoRequest\022\036\n\013device_uuid\030\001 \001(\0132\t.dmi."
+  "Uuid\022\024\n\014location_url\030\003 \001(\t\"\377\003\n\025UploadDeb"
+  "ugInfoStatus\022\036\n\013device_uuid\030\001 \001(\0132\t.dmi."
+  "Uuid\0227\n\006status\030\002 \001(\0162\'.dmi.UploadDebugIn"
+  "foStatus.UploadStatus\022\030\n\020percent_uploade"
+  "d\030\003 \001(\005\0221\n\006reason\030\004 \001(\0162!.dmi.UploadDebu"
+  "gInfoStatus.Reason\022\024\n\014location_url\030\005 \001(\t"
+  "\022\021\n\tfile_name\030\006 \001(\t\"U\n\014UploadStatus\022\033\n\027U"
+  "NDEFINED_UPLOAD_STATUS\020\000\022\014\n\010COMPLETE\020\001\022\017"
+  "\n\013IN_PROGRESS\020\002\022\t\n\005ERROR\020\003\"\277\001\n\006Reason\022\024\n"
+  "\020UNDEFINED_REASON\020\000\022\022\n\016UNKNOWN_DEVICE\020\001\022"
+  "\022\n\016INTERNAL_ERROR\020\002\022\026\n\022DEVICE_UNREACHABL"
+  "E\020\003\022\037\n\033REMOTE_LOCATION_UNREACHABLE\020\004\022%\n!"
+  "REMOTE_LOCATION_PERMISSION_DENIED\020\005\022\027\n\023E"
+  "RROR_DURING_UPLOAD\020\0062\234\004\n\037NativeSoftwareM"
+  "anagementService\022Q\n\022GetSoftwareVersion\022\017"
+  ".dmi.HardwareID\032*.dmi.GetSoftwareVersion"
+  "InformationResponse\022>\n\rDownloadImage\022\031.d"
+  "mi.DownloadImageRequest\032\020.dmi.ImageStatu"
+  "s0\001\0224\n\rActivateImage\022\017.dmi.HardwareID\032\020."
+  "dmi.ImageStatus0\001\022;\n\024RevertToStandbyImag"
+  "e\022\017.dmi.HardwareID\032\020.dmi.ImageStatus0\001\022G"
+  "\n\032UpdateStartupConfiguration\022\022.dmi.Confi"
+  "gRequest\032\023.dmi.ConfigResponse0\001\022\\\n\033GetSt"
+  "artupConfigurationInfo\022\035.dmi.StartupConf"
+  "igInfoRequest\032\036.dmi.StartupConfigInfoRes"
+  "ponse\022L\n\017UploadDebugInfo\022\033.dmi.UploadDeb"
+  "ugInfoRequest\032\032.dmi.UploadDebugInfoStatu"
+  "s0\001B;Z9github.com/opencord/device-manage"
+  "ment-interface/v3/go/dmib\006proto3"
   ;
 ::google::protobuf::internal::DescriptorTable descriptor_table_dmi_2fsw_5fmanagement_5fservice_2eproto = {
   false, InitDefaults_dmi_2fsw_5fmanagement_5fservice_2eproto, 
   descriptor_table_protodef_dmi_2fsw_5fmanagement_5fservice_2eproto,
-  "dmi/sw_management_service.proto", &assign_descriptors_table_dmi_2fsw_5fmanagement_5fservice_2eproto, 1840,
+  "dmi/sw_management_service.proto", &assign_descriptors_table_dmi_2fsw_5fmanagement_5fservice_2eproto, 2512,
 };
 
 void AddDescriptors_dmi_2fsw_5fmanagement_5fservice_2eproto() {
@@ -398,6 +477,62 @@
 const StartupConfigInfoResponse_Reason StartupConfigInfoResponse::Reason_MAX;
 const int StartupConfigInfoResponse::Reason_ARRAYSIZE;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+const ::google::protobuf::EnumDescriptor* UploadDebugInfoStatus_UploadStatus_descriptor() {
+  ::google::protobuf::internal::AssignDescriptors(&assign_descriptors_table_dmi_2fsw_5fmanagement_5fservice_2eproto);
+  return file_level_enum_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto[3];
+}
+bool UploadDebugInfoStatus_UploadStatus_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+      return true;
+    default:
+      return false;
+  }
+}
+
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus::UNDEFINED_UPLOAD_STATUS;
+const UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus::COMPLETE;
+const UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus::IN_PROGRESS;
+const UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus::ERROR;
+const UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus::UploadStatus_MIN;
+const UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus::UploadStatus_MAX;
+const int UploadDebugInfoStatus::UploadStatus_ARRAYSIZE;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+const ::google::protobuf::EnumDescriptor* UploadDebugInfoStatus_Reason_descriptor() {
+  ::google::protobuf::internal::AssignDescriptors(&assign_descriptors_table_dmi_2fsw_5fmanagement_5fservice_2eproto);
+  return file_level_enum_descriptors_dmi_2fsw_5fmanagement_5fservice_2eproto[4];
+}
+bool UploadDebugInfoStatus_Reason_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+    case 5:
+    case 6:
+      return true;
+    default:
+      return false;
+  }
+}
+
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::UNDEFINED_REASON;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::UNKNOWN_DEVICE;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::INTERNAL_ERROR;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::DEVICE_UNREACHABLE;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::REMOTE_LOCATION_UNREACHABLE;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::REMOTE_LOCATION_PERMISSION_DENIED;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::ERROR_DURING_UPLOAD;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::Reason_MIN;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus::Reason_MAX;
+const int UploadDebugInfoStatus::Reason_ARRAYSIZE;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 // ===================================================================
 
@@ -3175,6 +3310,959 @@
 }
 
 
+// ===================================================================
+
+void UploadDebugInfoRequest::InitAsDefaultInstance() {
+  ::dmi::_UploadDebugInfoRequest_default_instance_._instance.get_mutable()->device_uuid_ = const_cast< ::dmi::Uuid*>(
+      ::dmi::Uuid::internal_default_instance());
+}
+class UploadDebugInfoRequest::HasBitSetters {
+ public:
+  static const ::dmi::Uuid& device_uuid(const UploadDebugInfoRequest* msg);
+};
+
+const ::dmi::Uuid&
+UploadDebugInfoRequest::HasBitSetters::device_uuid(const UploadDebugInfoRequest* msg) {
+  return *msg->device_uuid_;
+}
+void UploadDebugInfoRequest::clear_device_uuid() {
+  if (GetArenaNoVirtual() == nullptr && device_uuid_ != nullptr) {
+    delete device_uuid_;
+  }
+  device_uuid_ = nullptr;
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int UploadDebugInfoRequest::kDeviceUuidFieldNumber;
+const int UploadDebugInfoRequest::kLocationUrlFieldNumber;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+UploadDebugInfoRequest::UploadDebugInfoRequest()
+  : ::google::protobuf::Message(), _internal_metadata_(nullptr) {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:dmi.UploadDebugInfoRequest)
+}
+UploadDebugInfoRequest::UploadDebugInfoRequest(const UploadDebugInfoRequest& from)
+  : ::google::protobuf::Message(),
+      _internal_metadata_(nullptr) {
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  location_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (from.location_url().size() > 0) {
+    location_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.location_url_);
+  }
+  if (from.has_device_uuid()) {
+    device_uuid_ = new ::dmi::Uuid(*from.device_uuid_);
+  } else {
+    device_uuid_ = nullptr;
+  }
+  // @@protoc_insertion_point(copy_constructor:dmi.UploadDebugInfoRequest)
+}
+
+void UploadDebugInfoRequest::SharedCtor() {
+  ::google::protobuf::internal::InitSCC(
+      &scc_info_UploadDebugInfoRequest_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
+  location_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  device_uuid_ = nullptr;
+}
+
+UploadDebugInfoRequest::~UploadDebugInfoRequest() {
+  // @@protoc_insertion_point(destructor:dmi.UploadDebugInfoRequest)
+  SharedDtor();
+}
+
+void UploadDebugInfoRequest::SharedDtor() {
+  location_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (this != internal_default_instance()) delete device_uuid_;
+}
+
+void UploadDebugInfoRequest::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
+const UploadDebugInfoRequest& UploadDebugInfoRequest::default_instance() {
+  ::google::protobuf::internal::InitSCC(&::scc_info_UploadDebugInfoRequest_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
+  return *internal_default_instance();
+}
+
+
+void UploadDebugInfoRequest::Clear() {
+// @@protoc_insertion_point(message_clear_start:dmi.UploadDebugInfoRequest)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  location_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (GetArenaNoVirtual() == nullptr && device_uuid_ != nullptr) {
+    delete device_uuid_;
+  }
+  device_uuid_ = nullptr;
+  _internal_metadata_.Clear();
+}
+
+#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+const char* UploadDebugInfoRequest::_InternalParse(const char* begin, const char* end, void* object,
+                  ::google::protobuf::internal::ParseContext* ctx) {
+  auto msg = static_cast<UploadDebugInfoRequest*>(object);
+  ::google::protobuf::int32 size; (void)size;
+  int depth; (void)depth;
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end;
+  auto ptr = begin;
+  while (ptr < end) {
+    ptr = ::google::protobuf::io::Parse32(ptr, &tag);
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+    switch (tag >> 3) {
+      // .dmi.Uuid device_uuid = 1;
+      case 1: {
+        if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual;
+        ptr = ::google::protobuf::io::ReadSize(ptr, &size);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        parser_till_end = ::dmi::Uuid::_InternalParse;
+        object = msg->mutable_device_uuid();
+        if (size > end - ptr) goto len_delim_till_end;
+        ptr += size;
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange(
+            {parser_till_end, object}, ptr - size, ptr));
+        break;
+      }
+      // string location_url = 3;
+      case 3: {
+        if (static_cast<::google::protobuf::uint8>(tag) != 26) goto handle_unusual;
+        ptr = ::google::protobuf::io::ReadSize(ptr, &size);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        ctx->extra_parse_data().SetFieldName("dmi.UploadDebugInfoRequest.location_url");
+        object = msg->mutable_location_url();
+        if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) {
+          parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8;
+          goto string_till_end;
+        }
+        GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx));
+        ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx);
+        ptr += size;
+        break;
+      }
+      default: {
+      handle_unusual:
+        if ((tag & 7) == 4 || tag == 0) {
+          ctx->EndGroup(tag);
+          return ptr;
+        }
+        auto res = UnknownFieldParse(tag, {_InternalParse, msg},
+          ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx);
+        ptr = res.first;
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr);
+        if (res.second) return ptr;
+      }
+    }  // switch
+  }  // while
+  return ptr;
+string_till_end:
+  static_cast<::std::string*>(object)->clear();
+  static_cast<::std::string*>(object)->reserve(size);
+  goto len_delim_till_end;
+len_delim_till_end:
+  return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg},
+                               {parser_till_end, object}, size);
+}
+#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+bool UploadDebugInfoRequest::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  // @@protoc_insertion_point(parse_start:dmi.UploadDebugInfoRequest)
+  for (;;) {
+    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // .dmi.Uuid device_uuid = 1;
+      case 1: {
+        if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+               input, mutable_device_uuid()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // string location_url = 3;
+      case 3: {
+        if (static_cast< ::google::protobuf::uint8>(tag) == (26 & 0xFF)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_location_url()));
+          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+            this->location_url().data(), static_cast<int>(this->location_url().length()),
+            ::google::protobuf::internal::WireFormatLite::PARSE,
+            "dmi.UploadDebugInfoRequest.location_url"));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      default: {
+      handle_unusual:
+        if (tag == 0) {
+          goto success;
+        }
+        DO_(::google::protobuf::internal::WireFormat::SkipField(
+              input, tag, _internal_metadata_.mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+success:
+  // @@protoc_insertion_point(parse_success:dmi.UploadDebugInfoRequest)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:dmi.UploadDebugInfoRequest)
+  return false;
+#undef DO_
+}
+#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+
+void UploadDebugInfoRequest::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:dmi.UploadDebugInfoRequest)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  // .dmi.Uuid device_uuid = 1;
+  if (this->has_device_uuid()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      1, HasBitSetters::device_uuid(this), output);
+  }
+
+  // string location_url = 3;
+  if (this->location_url().size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+      this->location_url().data(), static_cast<int>(this->location_url().length()),
+      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+      "dmi.UploadDebugInfoRequest.location_url");
+    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+      3, this->location_url(), output);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        _internal_metadata_.unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:dmi.UploadDebugInfoRequest)
+}
+
+::google::protobuf::uint8* UploadDebugInfoRequest::InternalSerializeWithCachedSizesToArray(
+    ::google::protobuf::uint8* target) const {
+  // @@protoc_insertion_point(serialize_to_array_start:dmi.UploadDebugInfoRequest)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  // .dmi.Uuid device_uuid = 1;
+  if (this->has_device_uuid()) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        1, HasBitSetters::device_uuid(this), target);
+  }
+
+  // string location_url = 3;
+  if (this->location_url().size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+      this->location_url().data(), static_cast<int>(this->location_url().length()),
+      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+      "dmi.UploadDebugInfoRequest.location_url");
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        3, this->location_url(), target);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields(), target);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:dmi.UploadDebugInfoRequest)
+  return target;
+}
+
+size_t UploadDebugInfoRequest::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:dmi.UploadDebugInfoRequest)
+  size_t total_size = 0;
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        _internal_metadata_.unknown_fields());
+  }
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // string location_url = 3;
+  if (this->location_url().size() > 0) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::StringSize(
+        this->location_url());
+  }
+
+  // .dmi.Uuid device_uuid = 1;
+  if (this->has_device_uuid()) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::MessageSize(
+        *device_uuid_);
+  }
+
+  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+  SetCachedSize(cached_size);
+  return total_size;
+}
+
+void UploadDebugInfoRequest::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:dmi.UploadDebugInfoRequest)
+  GOOGLE_DCHECK_NE(&from, this);
+  const UploadDebugInfoRequest* source =
+      ::google::protobuf::DynamicCastToGenerated<UploadDebugInfoRequest>(
+          &from);
+  if (source == nullptr) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:dmi.UploadDebugInfoRequest)
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:dmi.UploadDebugInfoRequest)
+    MergeFrom(*source);
+  }
+}
+
+void UploadDebugInfoRequest::MergeFrom(const UploadDebugInfoRequest& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:dmi.UploadDebugInfoRequest)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  if (from.location_url().size() > 0) {
+
+    location_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.location_url_);
+  }
+  if (from.has_device_uuid()) {
+    mutable_device_uuid()->::dmi::Uuid::MergeFrom(from.device_uuid());
+  }
+}
+
+void UploadDebugInfoRequest::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:dmi.UploadDebugInfoRequest)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void UploadDebugInfoRequest::CopyFrom(const UploadDebugInfoRequest& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:dmi.UploadDebugInfoRequest)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool UploadDebugInfoRequest::IsInitialized() const {
+  return true;
+}
+
+void UploadDebugInfoRequest::Swap(UploadDebugInfoRequest* other) {
+  if (other == this) return;
+  InternalSwap(other);
+}
+void UploadDebugInfoRequest::InternalSwap(UploadDebugInfoRequest* other) {
+  using std::swap;
+  _internal_metadata_.Swap(&other->_internal_metadata_);
+  location_url_.Swap(&other->location_url_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+    GetArenaNoVirtual());
+  swap(device_uuid_, other->device_uuid_);
+}
+
+::google::protobuf::Metadata UploadDebugInfoRequest::GetMetadata() const {
+  ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_dmi_2fsw_5fmanagement_5fservice_2eproto);
+  return ::file_level_metadata_dmi_2fsw_5fmanagement_5fservice_2eproto[kIndexInFileMessages];
+}
+
+
+// ===================================================================
+
+void UploadDebugInfoStatus::InitAsDefaultInstance() {
+  ::dmi::_UploadDebugInfoStatus_default_instance_._instance.get_mutable()->device_uuid_ = const_cast< ::dmi::Uuid*>(
+      ::dmi::Uuid::internal_default_instance());
+}
+class UploadDebugInfoStatus::HasBitSetters {
+ public:
+  static const ::dmi::Uuid& device_uuid(const UploadDebugInfoStatus* msg);
+};
+
+const ::dmi::Uuid&
+UploadDebugInfoStatus::HasBitSetters::device_uuid(const UploadDebugInfoStatus* msg) {
+  return *msg->device_uuid_;
+}
+void UploadDebugInfoStatus::clear_device_uuid() {
+  if (GetArenaNoVirtual() == nullptr && device_uuid_ != nullptr) {
+    delete device_uuid_;
+  }
+  device_uuid_ = nullptr;
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int UploadDebugInfoStatus::kDeviceUuidFieldNumber;
+const int UploadDebugInfoStatus::kStatusFieldNumber;
+const int UploadDebugInfoStatus::kPercentUploadedFieldNumber;
+const int UploadDebugInfoStatus::kReasonFieldNumber;
+const int UploadDebugInfoStatus::kLocationUrlFieldNumber;
+const int UploadDebugInfoStatus::kFileNameFieldNumber;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+UploadDebugInfoStatus::UploadDebugInfoStatus()
+  : ::google::protobuf::Message(), _internal_metadata_(nullptr) {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:dmi.UploadDebugInfoStatus)
+}
+UploadDebugInfoStatus::UploadDebugInfoStatus(const UploadDebugInfoStatus& from)
+  : ::google::protobuf::Message(),
+      _internal_metadata_(nullptr) {
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  location_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (from.location_url().size() > 0) {
+    location_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.location_url_);
+  }
+  file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (from.file_name().size() > 0) {
+    file_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.file_name_);
+  }
+  if (from.has_device_uuid()) {
+    device_uuid_ = new ::dmi::Uuid(*from.device_uuid_);
+  } else {
+    device_uuid_ = nullptr;
+  }
+  ::memcpy(&status_, &from.status_,
+    static_cast<size_t>(reinterpret_cast<char*>(&reason_) -
+    reinterpret_cast<char*>(&status_)) + sizeof(reason_));
+  // @@protoc_insertion_point(copy_constructor:dmi.UploadDebugInfoStatus)
+}
+
+void UploadDebugInfoStatus::SharedCtor() {
+  ::google::protobuf::internal::InitSCC(
+      &scc_info_UploadDebugInfoStatus_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
+  location_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  ::memset(&device_uuid_, 0, static_cast<size_t>(
+      reinterpret_cast<char*>(&reason_) -
+      reinterpret_cast<char*>(&device_uuid_)) + sizeof(reason_));
+}
+
+UploadDebugInfoStatus::~UploadDebugInfoStatus() {
+  // @@protoc_insertion_point(destructor:dmi.UploadDebugInfoStatus)
+  SharedDtor();
+}
+
+void UploadDebugInfoStatus::SharedDtor() {
+  location_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  file_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (this != internal_default_instance()) delete device_uuid_;
+}
+
+void UploadDebugInfoStatus::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
+const UploadDebugInfoStatus& UploadDebugInfoStatus::default_instance() {
+  ::google::protobuf::internal::InitSCC(&::scc_info_UploadDebugInfoStatus_dmi_2fsw_5fmanagement_5fservice_2eproto.base);
+  return *internal_default_instance();
+}
+
+
+void UploadDebugInfoStatus::Clear() {
+// @@protoc_insertion_point(message_clear_start:dmi.UploadDebugInfoStatus)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  location_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  if (GetArenaNoVirtual() == nullptr && device_uuid_ != nullptr) {
+    delete device_uuid_;
+  }
+  device_uuid_ = nullptr;
+  ::memset(&status_, 0, static_cast<size_t>(
+      reinterpret_cast<char*>(&reason_) -
+      reinterpret_cast<char*>(&status_)) + sizeof(reason_));
+  _internal_metadata_.Clear();
+}
+
+#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+const char* UploadDebugInfoStatus::_InternalParse(const char* begin, const char* end, void* object,
+                  ::google::protobuf::internal::ParseContext* ctx) {
+  auto msg = static_cast<UploadDebugInfoStatus*>(object);
+  ::google::protobuf::int32 size; (void)size;
+  int depth; (void)depth;
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end;
+  auto ptr = begin;
+  while (ptr < end) {
+    ptr = ::google::protobuf::io::Parse32(ptr, &tag);
+    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+    switch (tag >> 3) {
+      // .dmi.Uuid device_uuid = 1;
+      case 1: {
+        if (static_cast<::google::protobuf::uint8>(tag) != 10) goto handle_unusual;
+        ptr = ::google::protobuf::io::ReadSize(ptr, &size);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        parser_till_end = ::dmi::Uuid::_InternalParse;
+        object = msg->mutable_device_uuid();
+        if (size > end - ptr) goto len_delim_till_end;
+        ptr += size;
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ctx->ParseExactRange(
+            {parser_till_end, object}, ptr - size, ptr));
+        break;
+      }
+      // .dmi.UploadDebugInfoStatus.UploadStatus status = 2;
+      case 2: {
+        if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual;
+        ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr);
+        msg->set_status(static_cast<::dmi::UploadDebugInfoStatus_UploadStatus>(val));
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        break;
+      }
+      // int32 percent_uploaded = 3;
+      case 3: {
+        if (static_cast<::google::protobuf::uint8>(tag) != 24) goto handle_unusual;
+        msg->set_percent_uploaded(::google::protobuf::internal::ReadVarint(&ptr));
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        break;
+      }
+      // .dmi.UploadDebugInfoStatus.Reason reason = 4;
+      case 4: {
+        if (static_cast<::google::protobuf::uint8>(tag) != 32) goto handle_unusual;
+        ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr);
+        msg->set_reason(static_cast<::dmi::UploadDebugInfoStatus_Reason>(val));
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        break;
+      }
+      // string location_url = 5;
+      case 5: {
+        if (static_cast<::google::protobuf::uint8>(tag) != 42) goto handle_unusual;
+        ptr = ::google::protobuf::io::ReadSize(ptr, &size);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        ctx->extra_parse_data().SetFieldName("dmi.UploadDebugInfoStatus.location_url");
+        object = msg->mutable_location_url();
+        if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) {
+          parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8;
+          goto string_till_end;
+        }
+        GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx));
+        ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx);
+        ptr += size;
+        break;
+      }
+      // string file_name = 6;
+      case 6: {
+        if (static_cast<::google::protobuf::uint8>(tag) != 50) goto handle_unusual;
+        ptr = ::google::protobuf::io::ReadSize(ptr, &size);
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
+        ctx->extra_parse_data().SetFieldName("dmi.UploadDebugInfoStatus.file_name");
+        object = msg->mutable_file_name();
+        if (size > end - ptr + ::google::protobuf::internal::ParseContext::kSlopBytes) {
+          parser_till_end = ::google::protobuf::internal::GreedyStringParserUTF8;
+          goto string_till_end;
+        }
+        GOOGLE_PROTOBUF_PARSER_ASSERT(::google::protobuf::internal::StringCheckUTF8(ptr, size, ctx));
+        ::google::protobuf::internal::InlineGreedyStringParser(object, ptr, size, ctx);
+        ptr += size;
+        break;
+      }
+      default: {
+      handle_unusual:
+        if ((tag & 7) == 4 || tag == 0) {
+          ctx->EndGroup(tag);
+          return ptr;
+        }
+        auto res = UnknownFieldParse(tag, {_InternalParse, msg},
+          ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx);
+        ptr = res.first;
+        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr);
+        if (res.second) return ptr;
+      }
+    }  // switch
+  }  // while
+  return ptr;
+string_till_end:
+  static_cast<::std::string*>(object)->clear();
+  static_cast<::std::string*>(object)->reserve(size);
+  goto len_delim_till_end;
+len_delim_till_end:
+  return ctx->StoreAndTailCall(ptr, end, {_InternalParse, msg},
+                               {parser_till_end, object}, size);
+}
+#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+bool UploadDebugInfoStatus::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  // @@protoc_insertion_point(parse_start:dmi.UploadDebugInfoStatus)
+  for (;;) {
+    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // .dmi.Uuid device_uuid = 1;
+      case 1: {
+        if (static_cast< ::google::protobuf::uint8>(tag) == (10 & 0xFF)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
+               input, mutable_device_uuid()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // .dmi.UploadDebugInfoStatus.UploadStatus status = 2;
+      case 2: {
+        if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) {
+          int value = 0;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          set_status(static_cast< ::dmi::UploadDebugInfoStatus_UploadStatus >(value));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // int32 percent_uploaded = 3;
+      case 3: {
+        if (static_cast< ::google::protobuf::uint8>(tag) == (24 & 0xFF)) {
+
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &percent_uploaded_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // .dmi.UploadDebugInfoStatus.Reason reason = 4;
+      case 4: {
+        if (static_cast< ::google::protobuf::uint8>(tag) == (32 & 0xFF)) {
+          int value = 0;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          set_reason(static_cast< ::dmi::UploadDebugInfoStatus_Reason >(value));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // string location_url = 5;
+      case 5: {
+        if (static_cast< ::google::protobuf::uint8>(tag) == (42 & 0xFF)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_location_url()));
+          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+            this->location_url().data(), static_cast<int>(this->location_url().length()),
+            ::google::protobuf::internal::WireFormatLite::PARSE,
+            "dmi.UploadDebugInfoStatus.location_url"));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // string file_name = 6;
+      case 6: {
+        if (static_cast< ::google::protobuf::uint8>(tag) == (50 & 0xFF)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_file_name()));
+          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+            this->file_name().data(), static_cast<int>(this->file_name().length()),
+            ::google::protobuf::internal::WireFormatLite::PARSE,
+            "dmi.UploadDebugInfoStatus.file_name"));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      default: {
+      handle_unusual:
+        if (tag == 0) {
+          goto success;
+        }
+        DO_(::google::protobuf::internal::WireFormat::SkipField(
+              input, tag, _internal_metadata_.mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+success:
+  // @@protoc_insertion_point(parse_success:dmi.UploadDebugInfoStatus)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:dmi.UploadDebugInfoStatus)
+  return false;
+#undef DO_
+}
+#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+
+void UploadDebugInfoStatus::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:dmi.UploadDebugInfoStatus)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  // .dmi.Uuid device_uuid = 1;
+  if (this->has_device_uuid()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      1, HasBitSetters::device_uuid(this), output);
+  }
+
+  // .dmi.UploadDebugInfoStatus.UploadStatus status = 2;
+  if (this->status() != 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      2, this->status(), output);
+  }
+
+  // int32 percent_uploaded = 3;
+  if (this->percent_uploaded() != 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->percent_uploaded(), output);
+  }
+
+  // .dmi.UploadDebugInfoStatus.Reason reason = 4;
+  if (this->reason() != 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      4, this->reason(), output);
+  }
+
+  // string location_url = 5;
+  if (this->location_url().size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+      this->location_url().data(), static_cast<int>(this->location_url().length()),
+      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+      "dmi.UploadDebugInfoStatus.location_url");
+    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+      5, this->location_url(), output);
+  }
+
+  // string file_name = 6;
+  if (this->file_name().size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+      this->file_name().data(), static_cast<int>(this->file_name().length()),
+      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+      "dmi.UploadDebugInfoStatus.file_name");
+    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
+      6, this->file_name(), output);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        _internal_metadata_.unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:dmi.UploadDebugInfoStatus)
+}
+
+::google::protobuf::uint8* UploadDebugInfoStatus::InternalSerializeWithCachedSizesToArray(
+    ::google::protobuf::uint8* target) const {
+  // @@protoc_insertion_point(serialize_to_array_start:dmi.UploadDebugInfoStatus)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  // .dmi.Uuid device_uuid = 1;
+  if (this->has_device_uuid()) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      InternalWriteMessageToArray(
+        1, HasBitSetters::device_uuid(this), target);
+  }
+
+  // .dmi.UploadDebugInfoStatus.UploadStatus status = 2;
+  if (this->status() != 0) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      2, this->status(), target);
+  }
+
+  // int32 percent_uploaded = 3;
+  if (this->percent_uploaded() != 0) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->percent_uploaded(), target);
+  }
+
+  // .dmi.UploadDebugInfoStatus.Reason reason = 4;
+  if (this->reason() != 0) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      4, this->reason(), target);
+  }
+
+  // string location_url = 5;
+  if (this->location_url().size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+      this->location_url().data(), static_cast<int>(this->location_url().length()),
+      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+      "dmi.UploadDebugInfoStatus.location_url");
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        5, this->location_url(), target);
+  }
+
+  // string file_name = 6;
+  if (this->file_name().size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
+      this->file_name().data(), static_cast<int>(this->file_name().length()),
+      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
+      "dmi.UploadDebugInfoStatus.file_name");
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        6, this->file_name(), target);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields(), target);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:dmi.UploadDebugInfoStatus)
+  return target;
+}
+
+size_t UploadDebugInfoStatus::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:dmi.UploadDebugInfoStatus)
+  size_t total_size = 0;
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        _internal_metadata_.unknown_fields());
+  }
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // string location_url = 5;
+  if (this->location_url().size() > 0) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::StringSize(
+        this->location_url());
+  }
+
+  // string file_name = 6;
+  if (this->file_name().size() > 0) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::StringSize(
+        this->file_name());
+  }
+
+  // .dmi.Uuid device_uuid = 1;
+  if (this->has_device_uuid()) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::MessageSize(
+        *device_uuid_);
+  }
+
+  // .dmi.UploadDebugInfoStatus.UploadStatus status = 2;
+  if (this->status() != 0) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->status());
+  }
+
+  // int32 percent_uploaded = 3;
+  if (this->percent_uploaded() != 0) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::Int32Size(
+        this->percent_uploaded());
+  }
+
+  // .dmi.UploadDebugInfoStatus.Reason reason = 4;
+  if (this->reason() != 0) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->reason());
+  }
+
+  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+  SetCachedSize(cached_size);
+  return total_size;
+}
+
+void UploadDebugInfoStatus::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:dmi.UploadDebugInfoStatus)
+  GOOGLE_DCHECK_NE(&from, this);
+  const UploadDebugInfoStatus* source =
+      ::google::protobuf::DynamicCastToGenerated<UploadDebugInfoStatus>(
+          &from);
+  if (source == nullptr) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:dmi.UploadDebugInfoStatus)
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:dmi.UploadDebugInfoStatus)
+    MergeFrom(*source);
+  }
+}
+
+void UploadDebugInfoStatus::MergeFrom(const UploadDebugInfoStatus& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:dmi.UploadDebugInfoStatus)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  if (from.location_url().size() > 0) {
+
+    location_url_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.location_url_);
+  }
+  if (from.file_name().size() > 0) {
+
+    file_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.file_name_);
+  }
+  if (from.has_device_uuid()) {
+    mutable_device_uuid()->::dmi::Uuid::MergeFrom(from.device_uuid());
+  }
+  if (from.status() != 0) {
+    set_status(from.status());
+  }
+  if (from.percent_uploaded() != 0) {
+    set_percent_uploaded(from.percent_uploaded());
+  }
+  if (from.reason() != 0) {
+    set_reason(from.reason());
+  }
+}
+
+void UploadDebugInfoStatus::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:dmi.UploadDebugInfoStatus)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void UploadDebugInfoStatus::CopyFrom(const UploadDebugInfoStatus& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:dmi.UploadDebugInfoStatus)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool UploadDebugInfoStatus::IsInitialized() const {
+  return true;
+}
+
+void UploadDebugInfoStatus::Swap(UploadDebugInfoStatus* other) {
+  if (other == this) return;
+  InternalSwap(other);
+}
+void UploadDebugInfoStatus::InternalSwap(UploadDebugInfoStatus* other) {
+  using std::swap;
+  _internal_metadata_.Swap(&other->_internal_metadata_);
+  location_url_.Swap(&other->location_url_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+    GetArenaNoVirtual());
+  file_name_.Swap(&other->file_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+    GetArenaNoVirtual());
+  swap(device_uuid_, other->device_uuid_);
+  swap(status_, other->status_);
+  swap(percent_uploaded_, other->percent_uploaded_);
+  swap(reason_, other->reason_);
+}
+
+::google::protobuf::Metadata UploadDebugInfoStatus::GetMetadata() const {
+  ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_dmi_2fsw_5fmanagement_5fservice_2eproto);
+  return ::file_level_metadata_dmi_2fsw_5fmanagement_5fservice_2eproto[kIndexInFileMessages];
+}
+
+
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace dmi
 namespace google {
@@ -3200,6 +4288,12 @@
 template<> PROTOBUF_NOINLINE ::dmi::StartupConfigInfoResponse* Arena::CreateMaybeMessage< ::dmi::StartupConfigInfoResponse >(Arena* arena) {
   return Arena::CreateInternal< ::dmi::StartupConfigInfoResponse >(arena);
 }
+template<> PROTOBUF_NOINLINE ::dmi::UploadDebugInfoRequest* Arena::CreateMaybeMessage< ::dmi::UploadDebugInfoRequest >(Arena* arena) {
+  return Arena::CreateInternal< ::dmi::UploadDebugInfoRequest >(arena);
+}
+template<> PROTOBUF_NOINLINE ::dmi::UploadDebugInfoStatus* Arena::CreateMaybeMessage< ::dmi::UploadDebugInfoStatus >(Arena* arena) {
+  return Arena::CreateInternal< ::dmi::UploadDebugInfoStatus >(arena);
+}
 }  // namespace protobuf
 }  // namespace google
 
diff --git a/cpp/dmi/sw_management_service.pb.h b/cpp/dmi/sw_management_service.pb.h
index 2610c1a..82b897a 100644
--- a/cpp/dmi/sw_management_service.pb.h
+++ b/cpp/dmi/sw_management_service.pb.h
@@ -45,7 +45,7 @@
     PROTOBUF_SECTION_VARIABLE(protodesc_cold);
   static const ::google::protobuf::internal::AuxillaryParseTableField aux[]
     PROTOBUF_SECTION_VARIABLE(protodesc_cold);
-  static const ::google::protobuf::internal::ParseTable schema[7]
+  static const ::google::protobuf::internal::ParseTable schema[9]
     PROTOBUF_SECTION_VARIABLE(protodesc_cold);
   static const ::google::protobuf::internal::FieldMetadata field_metadata[];
   static const ::google::protobuf::internal::SerializationTable serialization_table[];
@@ -74,6 +74,12 @@
 class StartupConfigInfoResponse;
 class StartupConfigInfoResponseDefaultTypeInternal;
 extern StartupConfigInfoResponseDefaultTypeInternal _StartupConfigInfoResponse_default_instance_;
+class UploadDebugInfoRequest;
+class UploadDebugInfoRequestDefaultTypeInternal;
+extern UploadDebugInfoRequestDefaultTypeInternal _UploadDebugInfoRequest_default_instance_;
+class UploadDebugInfoStatus;
+class UploadDebugInfoStatusDefaultTypeInternal;
+extern UploadDebugInfoStatusDefaultTypeInternal _UploadDebugInfoStatus_default_instance_;
 }  // namespace dmi
 namespace google {
 namespace protobuf {
@@ -84,6 +90,8 @@
 template<> ::dmi::SoftwareVersionInformation* Arena::CreateMaybeMessage<::dmi::SoftwareVersionInformation>(Arena*);
 template<> ::dmi::StartupConfigInfoRequest* Arena::CreateMaybeMessage<::dmi::StartupConfigInfoRequest>(Arena*);
 template<> ::dmi::StartupConfigInfoResponse* Arena::CreateMaybeMessage<::dmi::StartupConfigInfoResponse>(Arena*);
+template<> ::dmi::UploadDebugInfoRequest* Arena::CreateMaybeMessage<::dmi::UploadDebugInfoRequest>(Arena*);
+template<> ::dmi::UploadDebugInfoStatus* Arena::CreateMaybeMessage<::dmi::UploadDebugInfoStatus>(Arena*);
 }  // namespace protobuf
 }  // namespace google
 namespace dmi {
@@ -160,6 +168,55 @@
   return ::google::protobuf::internal::ParseNamedEnum<StartupConfigInfoResponse_Reason>(
     StartupConfigInfoResponse_Reason_descriptor(), name, value);
 }
+enum UploadDebugInfoStatus_UploadStatus {
+  UploadDebugInfoStatus_UploadStatus_UNDEFINED_UPLOAD_STATUS = 0,
+  UploadDebugInfoStatus_UploadStatus_COMPLETE = 1,
+  UploadDebugInfoStatus_UploadStatus_IN_PROGRESS = 2,
+  UploadDebugInfoStatus_UploadStatus_ERROR = 3,
+  UploadDebugInfoStatus_UploadStatus_UploadDebugInfoStatus_UploadStatus_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::min(),
+  UploadDebugInfoStatus_UploadStatus_UploadDebugInfoStatus_UploadStatus_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::max()
+};
+bool UploadDebugInfoStatus_UploadStatus_IsValid(int value);
+const UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus_UploadStatus_UploadStatus_MIN = UploadDebugInfoStatus_UploadStatus_UNDEFINED_UPLOAD_STATUS;
+const UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus_UploadStatus_UploadStatus_MAX = UploadDebugInfoStatus_UploadStatus_ERROR;
+const int UploadDebugInfoStatus_UploadStatus_UploadStatus_ARRAYSIZE = UploadDebugInfoStatus_UploadStatus_UploadStatus_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* UploadDebugInfoStatus_UploadStatus_descriptor();
+inline const ::std::string& UploadDebugInfoStatus_UploadStatus_Name(UploadDebugInfoStatus_UploadStatus value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    UploadDebugInfoStatus_UploadStatus_descriptor(), value);
+}
+inline bool UploadDebugInfoStatus_UploadStatus_Parse(
+    const ::std::string& name, UploadDebugInfoStatus_UploadStatus* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<UploadDebugInfoStatus_UploadStatus>(
+    UploadDebugInfoStatus_UploadStatus_descriptor(), name, value);
+}
+enum UploadDebugInfoStatus_Reason {
+  UploadDebugInfoStatus_Reason_UNDEFINED_REASON = 0,
+  UploadDebugInfoStatus_Reason_UNKNOWN_DEVICE = 1,
+  UploadDebugInfoStatus_Reason_INTERNAL_ERROR = 2,
+  UploadDebugInfoStatus_Reason_DEVICE_UNREACHABLE = 3,
+  UploadDebugInfoStatus_Reason_REMOTE_LOCATION_UNREACHABLE = 4,
+  UploadDebugInfoStatus_Reason_REMOTE_LOCATION_PERMISSION_DENIED = 5,
+  UploadDebugInfoStatus_Reason_ERROR_DURING_UPLOAD = 6,
+  UploadDebugInfoStatus_Reason_UploadDebugInfoStatus_Reason_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::min(),
+  UploadDebugInfoStatus_Reason_UploadDebugInfoStatus_Reason_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::google::protobuf::int32>::max()
+};
+bool UploadDebugInfoStatus_Reason_IsValid(int value);
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus_Reason_Reason_MIN = UploadDebugInfoStatus_Reason_UNDEFINED_REASON;
+const UploadDebugInfoStatus_Reason UploadDebugInfoStatus_Reason_Reason_MAX = UploadDebugInfoStatus_Reason_ERROR_DURING_UPLOAD;
+const int UploadDebugInfoStatus_Reason_Reason_ARRAYSIZE = UploadDebugInfoStatus_Reason_Reason_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* UploadDebugInfoStatus_Reason_descriptor();
+inline const ::std::string& UploadDebugInfoStatus_Reason_Name(UploadDebugInfoStatus_Reason value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    UploadDebugInfoStatus_Reason_descriptor(), value);
+}
+inline bool UploadDebugInfoStatus_Reason_Parse(
+    const ::std::string& name, UploadDebugInfoStatus_Reason* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<UploadDebugInfoStatus_Reason>(
+    UploadDebugInfoStatus_Reason_descriptor(), name, value);
+}
 // ===================================================================
 
 class SoftwareVersionInformation final :
@@ -1199,6 +1256,368 @@
   mutable ::google::protobuf::internal::CachedSize _cached_size_;
   friend struct ::TableStruct_dmi_2fsw_5fmanagement_5fservice_2eproto;
 };
+// -------------------------------------------------------------------
+
+class UploadDebugInfoRequest final :
+    public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:dmi.UploadDebugInfoRequest) */ {
+ public:
+  UploadDebugInfoRequest();
+  virtual ~UploadDebugInfoRequest();
+
+  UploadDebugInfoRequest(const UploadDebugInfoRequest& from);
+
+  inline UploadDebugInfoRequest& operator=(const UploadDebugInfoRequest& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  #if LANG_CXX11
+  UploadDebugInfoRequest(UploadDebugInfoRequest&& from) noexcept
+    : UploadDebugInfoRequest() {
+    *this = ::std::move(from);
+  }
+
+  inline UploadDebugInfoRequest& operator=(UploadDebugInfoRequest&& from) noexcept {
+    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+  #endif
+  static const ::google::protobuf::Descriptor* descriptor() {
+    return default_instance().GetDescriptor();
+  }
+  static const UploadDebugInfoRequest& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const UploadDebugInfoRequest* internal_default_instance() {
+    return reinterpret_cast<const UploadDebugInfoRequest*>(
+               &_UploadDebugInfoRequest_default_instance_);
+  }
+  static constexpr int kIndexInFileMessages =
+    7;
+
+  void Swap(UploadDebugInfoRequest* other);
+  friend void swap(UploadDebugInfoRequest& a, UploadDebugInfoRequest& b) {
+    a.Swap(&b);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline UploadDebugInfoRequest* New() const final {
+    return CreateMaybeMessage<UploadDebugInfoRequest>(nullptr);
+  }
+
+  UploadDebugInfoRequest* New(::google::protobuf::Arena* arena) const final {
+    return CreateMaybeMessage<UploadDebugInfoRequest>(arena);
+  }
+  void CopyFrom(const ::google::protobuf::Message& from) final;
+  void MergeFrom(const ::google::protobuf::Message& from) final;
+  void CopyFrom(const UploadDebugInfoRequest& from);
+  void MergeFrom(const UploadDebugInfoRequest& from);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+  static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx);
+  ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; }
+  #else
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input) final;
+  #endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const final;
+  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
+      ::google::protobuf::uint8* target) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const final;
+  void InternalSwap(UploadDebugInfoRequest* other);
+  private:
+  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+    return nullptr;
+  }
+  inline void* MaybeArenaPtr() const {
+    return nullptr;
+  }
+  public:
+
+  ::google::protobuf::Metadata GetMetadata() const final;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // string location_url = 3;
+  void clear_location_url();
+  static const int kLocationUrlFieldNumber = 3;
+  const ::std::string& location_url() const;
+  void set_location_url(const ::std::string& value);
+  #if LANG_CXX11
+  void set_location_url(::std::string&& value);
+  #endif
+  void set_location_url(const char* value);
+  void set_location_url(const char* value, size_t size);
+  ::std::string* mutable_location_url();
+  ::std::string* release_location_url();
+  void set_allocated_location_url(::std::string* location_url);
+
+  // .dmi.Uuid device_uuid = 1;
+  bool has_device_uuid() const;
+  void clear_device_uuid();
+  static const int kDeviceUuidFieldNumber = 1;
+  const ::dmi::Uuid& device_uuid() const;
+  ::dmi::Uuid* release_device_uuid();
+  ::dmi::Uuid* mutable_device_uuid();
+  void set_allocated_device_uuid(::dmi::Uuid* device_uuid);
+
+  // @@protoc_insertion_point(class_scope:dmi.UploadDebugInfoRequest)
+ private:
+  class HasBitSetters;
+
+  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+  ::google::protobuf::internal::ArenaStringPtr location_url_;
+  ::dmi::Uuid* device_uuid_;
+  mutable ::google::protobuf::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_dmi_2fsw_5fmanagement_5fservice_2eproto;
+};
+// -------------------------------------------------------------------
+
+class UploadDebugInfoStatus final :
+    public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:dmi.UploadDebugInfoStatus) */ {
+ public:
+  UploadDebugInfoStatus();
+  virtual ~UploadDebugInfoStatus();
+
+  UploadDebugInfoStatus(const UploadDebugInfoStatus& from);
+
+  inline UploadDebugInfoStatus& operator=(const UploadDebugInfoStatus& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  #if LANG_CXX11
+  UploadDebugInfoStatus(UploadDebugInfoStatus&& from) noexcept
+    : UploadDebugInfoStatus() {
+    *this = ::std::move(from);
+  }
+
+  inline UploadDebugInfoStatus& operator=(UploadDebugInfoStatus&& from) noexcept {
+    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+  #endif
+  static const ::google::protobuf::Descriptor* descriptor() {
+    return default_instance().GetDescriptor();
+  }
+  static const UploadDebugInfoStatus& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const UploadDebugInfoStatus* internal_default_instance() {
+    return reinterpret_cast<const UploadDebugInfoStatus*>(
+               &_UploadDebugInfoStatus_default_instance_);
+  }
+  static constexpr int kIndexInFileMessages =
+    8;
+
+  void Swap(UploadDebugInfoStatus* other);
+  friend void swap(UploadDebugInfoStatus& a, UploadDebugInfoStatus& b) {
+    a.Swap(&b);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline UploadDebugInfoStatus* New() const final {
+    return CreateMaybeMessage<UploadDebugInfoStatus>(nullptr);
+  }
+
+  UploadDebugInfoStatus* New(::google::protobuf::Arena* arena) const final {
+    return CreateMaybeMessage<UploadDebugInfoStatus>(arena);
+  }
+  void CopyFrom(const ::google::protobuf::Message& from) final;
+  void MergeFrom(const ::google::protobuf::Message& from) final;
+  void CopyFrom(const UploadDebugInfoStatus& from);
+  void MergeFrom(const UploadDebugInfoStatus& from);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+  static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx);
+  ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; }
+  #else
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input) final;
+  #endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const final;
+  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
+      ::google::protobuf::uint8* target) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const final;
+  void InternalSwap(UploadDebugInfoStatus* other);
+  private:
+  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+    return nullptr;
+  }
+  inline void* MaybeArenaPtr() const {
+    return nullptr;
+  }
+  public:
+
+  ::google::protobuf::Metadata GetMetadata() const final;
+
+  // nested types ----------------------------------------------------
+
+  typedef UploadDebugInfoStatus_UploadStatus UploadStatus;
+  static const UploadStatus UNDEFINED_UPLOAD_STATUS =
+    UploadDebugInfoStatus_UploadStatus_UNDEFINED_UPLOAD_STATUS;
+  static const UploadStatus COMPLETE =
+    UploadDebugInfoStatus_UploadStatus_COMPLETE;
+  static const UploadStatus IN_PROGRESS =
+    UploadDebugInfoStatus_UploadStatus_IN_PROGRESS;
+  static const UploadStatus ERROR =
+    UploadDebugInfoStatus_UploadStatus_ERROR;
+  static inline bool UploadStatus_IsValid(int value) {
+    return UploadDebugInfoStatus_UploadStatus_IsValid(value);
+  }
+  static const UploadStatus UploadStatus_MIN =
+    UploadDebugInfoStatus_UploadStatus_UploadStatus_MIN;
+  static const UploadStatus UploadStatus_MAX =
+    UploadDebugInfoStatus_UploadStatus_UploadStatus_MAX;
+  static const int UploadStatus_ARRAYSIZE =
+    UploadDebugInfoStatus_UploadStatus_UploadStatus_ARRAYSIZE;
+  static inline const ::google::protobuf::EnumDescriptor*
+  UploadStatus_descriptor() {
+    return UploadDebugInfoStatus_UploadStatus_descriptor();
+  }
+  static inline const ::std::string& UploadStatus_Name(UploadStatus value) {
+    return UploadDebugInfoStatus_UploadStatus_Name(value);
+  }
+  static inline bool UploadStatus_Parse(const ::std::string& name,
+      UploadStatus* value) {
+    return UploadDebugInfoStatus_UploadStatus_Parse(name, value);
+  }
+
+  typedef UploadDebugInfoStatus_Reason Reason;
+  static const Reason UNDEFINED_REASON =
+    UploadDebugInfoStatus_Reason_UNDEFINED_REASON;
+  static const Reason UNKNOWN_DEVICE =
+    UploadDebugInfoStatus_Reason_UNKNOWN_DEVICE;
+  static const Reason INTERNAL_ERROR =
+    UploadDebugInfoStatus_Reason_INTERNAL_ERROR;
+  static const Reason DEVICE_UNREACHABLE =
+    UploadDebugInfoStatus_Reason_DEVICE_UNREACHABLE;
+  static const Reason REMOTE_LOCATION_UNREACHABLE =
+    UploadDebugInfoStatus_Reason_REMOTE_LOCATION_UNREACHABLE;
+  static const Reason REMOTE_LOCATION_PERMISSION_DENIED =
+    UploadDebugInfoStatus_Reason_REMOTE_LOCATION_PERMISSION_DENIED;
+  static const Reason ERROR_DURING_UPLOAD =
+    UploadDebugInfoStatus_Reason_ERROR_DURING_UPLOAD;
+  static inline bool Reason_IsValid(int value) {
+    return UploadDebugInfoStatus_Reason_IsValid(value);
+  }
+  static const Reason Reason_MIN =
+    UploadDebugInfoStatus_Reason_Reason_MIN;
+  static const Reason Reason_MAX =
+    UploadDebugInfoStatus_Reason_Reason_MAX;
+  static const int Reason_ARRAYSIZE =
+    UploadDebugInfoStatus_Reason_Reason_ARRAYSIZE;
+  static inline const ::google::protobuf::EnumDescriptor*
+  Reason_descriptor() {
+    return UploadDebugInfoStatus_Reason_descriptor();
+  }
+  static inline const ::std::string& Reason_Name(Reason value) {
+    return UploadDebugInfoStatus_Reason_Name(value);
+  }
+  static inline bool Reason_Parse(const ::std::string& name,
+      Reason* value) {
+    return UploadDebugInfoStatus_Reason_Parse(name, value);
+  }
+
+  // accessors -------------------------------------------------------
+
+  // string location_url = 5;
+  void clear_location_url();
+  static const int kLocationUrlFieldNumber = 5;
+  const ::std::string& location_url() const;
+  void set_location_url(const ::std::string& value);
+  #if LANG_CXX11
+  void set_location_url(::std::string&& value);
+  #endif
+  void set_location_url(const char* value);
+  void set_location_url(const char* value, size_t size);
+  ::std::string* mutable_location_url();
+  ::std::string* release_location_url();
+  void set_allocated_location_url(::std::string* location_url);
+
+  // string file_name = 6;
+  void clear_file_name();
+  static const int kFileNameFieldNumber = 6;
+  const ::std::string& file_name() const;
+  void set_file_name(const ::std::string& value);
+  #if LANG_CXX11
+  void set_file_name(::std::string&& value);
+  #endif
+  void set_file_name(const char* value);
+  void set_file_name(const char* value, size_t size);
+  ::std::string* mutable_file_name();
+  ::std::string* release_file_name();
+  void set_allocated_file_name(::std::string* file_name);
+
+  // .dmi.Uuid device_uuid = 1;
+  bool has_device_uuid() const;
+  void clear_device_uuid();
+  static const int kDeviceUuidFieldNumber = 1;
+  const ::dmi::Uuid& device_uuid() const;
+  ::dmi::Uuid* release_device_uuid();
+  ::dmi::Uuid* mutable_device_uuid();
+  void set_allocated_device_uuid(::dmi::Uuid* device_uuid);
+
+  // .dmi.UploadDebugInfoStatus.UploadStatus status = 2;
+  void clear_status();
+  static const int kStatusFieldNumber = 2;
+  ::dmi::UploadDebugInfoStatus_UploadStatus status() const;
+  void set_status(::dmi::UploadDebugInfoStatus_UploadStatus value);
+
+  // int32 percent_uploaded = 3;
+  void clear_percent_uploaded();
+  static const int kPercentUploadedFieldNumber = 3;
+  ::google::protobuf::int32 percent_uploaded() const;
+  void set_percent_uploaded(::google::protobuf::int32 value);
+
+  // .dmi.UploadDebugInfoStatus.Reason reason = 4;
+  void clear_reason();
+  static const int kReasonFieldNumber = 4;
+  ::dmi::UploadDebugInfoStatus_Reason reason() const;
+  void set_reason(::dmi::UploadDebugInfoStatus_Reason value);
+
+  // @@protoc_insertion_point(class_scope:dmi.UploadDebugInfoStatus)
+ private:
+  class HasBitSetters;
+
+  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+  ::google::protobuf::internal::ArenaStringPtr location_url_;
+  ::google::protobuf::internal::ArenaStringPtr file_name_;
+  ::dmi::Uuid* device_uuid_;
+  int status_;
+  ::google::protobuf::int32 percent_uploaded_;
+  int reason_;
+  mutable ::google::protobuf::internal::CachedSize _cached_size_;
+  friend struct ::TableStruct_dmi_2fsw_5fmanagement_5fservice_2eproto;
+};
 // ===================================================================
 
 
@@ -1921,6 +2340,305 @@
   // @@protoc_insertion_point(field_set_allocated:dmi.StartupConfigInfoResponse.reason_detail)
 }
 
+// -------------------------------------------------------------------
+
+// UploadDebugInfoRequest
+
+// .dmi.Uuid device_uuid = 1;
+inline bool UploadDebugInfoRequest::has_device_uuid() const {
+  return this != internal_default_instance() && device_uuid_ != nullptr;
+}
+inline const ::dmi::Uuid& UploadDebugInfoRequest::device_uuid() const {
+  const ::dmi::Uuid* p = device_uuid_;
+  // @@protoc_insertion_point(field_get:dmi.UploadDebugInfoRequest.device_uuid)
+  return p != nullptr ? *p : *reinterpret_cast<const ::dmi::Uuid*>(
+      &::dmi::_Uuid_default_instance_);
+}
+inline ::dmi::Uuid* UploadDebugInfoRequest::release_device_uuid() {
+  // @@protoc_insertion_point(field_release:dmi.UploadDebugInfoRequest.device_uuid)
+  
+  ::dmi::Uuid* temp = device_uuid_;
+  device_uuid_ = nullptr;
+  return temp;
+}
+inline ::dmi::Uuid* UploadDebugInfoRequest::mutable_device_uuid() {
+  
+  if (device_uuid_ == nullptr) {
+    auto* p = CreateMaybeMessage<::dmi::Uuid>(GetArenaNoVirtual());
+    device_uuid_ = p;
+  }
+  // @@protoc_insertion_point(field_mutable:dmi.UploadDebugInfoRequest.device_uuid)
+  return device_uuid_;
+}
+inline void UploadDebugInfoRequest::set_allocated_device_uuid(::dmi::Uuid* device_uuid) {
+  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::google::protobuf::MessageLite*>(device_uuid_);
+  }
+  if (device_uuid) {
+    ::google::protobuf::Arena* submessage_arena = nullptr;
+    if (message_arena != submessage_arena) {
+      device_uuid = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, device_uuid, submessage_arena);
+    }
+    
+  } else {
+    
+  }
+  device_uuid_ = device_uuid;
+  // @@protoc_insertion_point(field_set_allocated:dmi.UploadDebugInfoRequest.device_uuid)
+}
+
+// string location_url = 3;
+inline void UploadDebugInfoRequest::clear_location_url() {
+  location_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& UploadDebugInfoRequest::location_url() const {
+  // @@protoc_insertion_point(field_get:dmi.UploadDebugInfoRequest.location_url)
+  return location_url_.GetNoArena();
+}
+inline void UploadDebugInfoRequest::set_location_url(const ::std::string& value) {
+  
+  location_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:dmi.UploadDebugInfoRequest.location_url)
+}
+#if LANG_CXX11
+inline void UploadDebugInfoRequest::set_location_url(::std::string&& value) {
+  
+  location_url_.SetNoArena(
+    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+  // @@protoc_insertion_point(field_set_rvalue:dmi.UploadDebugInfoRequest.location_url)
+}
+#endif
+inline void UploadDebugInfoRequest::set_location_url(const char* value) {
+  GOOGLE_DCHECK(value != nullptr);
+  
+  location_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:dmi.UploadDebugInfoRequest.location_url)
+}
+inline void UploadDebugInfoRequest::set_location_url(const char* value, size_t size) {
+  
+  location_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+      ::std::string(reinterpret_cast<const char*>(value), size));
+  // @@protoc_insertion_point(field_set_pointer:dmi.UploadDebugInfoRequest.location_url)
+}
+inline ::std::string* UploadDebugInfoRequest::mutable_location_url() {
+  
+  // @@protoc_insertion_point(field_mutable:dmi.UploadDebugInfoRequest.location_url)
+  return location_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* UploadDebugInfoRequest::release_location_url() {
+  // @@protoc_insertion_point(field_release:dmi.UploadDebugInfoRequest.location_url)
+  
+  return location_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void UploadDebugInfoRequest::set_allocated_location_url(::std::string* location_url) {
+  if (location_url != nullptr) {
+    
+  } else {
+    
+  }
+  location_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), location_url);
+  // @@protoc_insertion_point(field_set_allocated:dmi.UploadDebugInfoRequest.location_url)
+}
+
+// -------------------------------------------------------------------
+
+// UploadDebugInfoStatus
+
+// .dmi.Uuid device_uuid = 1;
+inline bool UploadDebugInfoStatus::has_device_uuid() const {
+  return this != internal_default_instance() && device_uuid_ != nullptr;
+}
+inline const ::dmi::Uuid& UploadDebugInfoStatus::device_uuid() const {
+  const ::dmi::Uuid* p = device_uuid_;
+  // @@protoc_insertion_point(field_get:dmi.UploadDebugInfoStatus.device_uuid)
+  return p != nullptr ? *p : *reinterpret_cast<const ::dmi::Uuid*>(
+      &::dmi::_Uuid_default_instance_);
+}
+inline ::dmi::Uuid* UploadDebugInfoStatus::release_device_uuid() {
+  // @@protoc_insertion_point(field_release:dmi.UploadDebugInfoStatus.device_uuid)
+  
+  ::dmi::Uuid* temp = device_uuid_;
+  device_uuid_ = nullptr;
+  return temp;
+}
+inline ::dmi::Uuid* UploadDebugInfoStatus::mutable_device_uuid() {
+  
+  if (device_uuid_ == nullptr) {
+    auto* p = CreateMaybeMessage<::dmi::Uuid>(GetArenaNoVirtual());
+    device_uuid_ = p;
+  }
+  // @@protoc_insertion_point(field_mutable:dmi.UploadDebugInfoStatus.device_uuid)
+  return device_uuid_;
+}
+inline void UploadDebugInfoStatus::set_allocated_device_uuid(::dmi::Uuid* device_uuid) {
+  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::google::protobuf::MessageLite*>(device_uuid_);
+  }
+  if (device_uuid) {
+    ::google::protobuf::Arena* submessage_arena = nullptr;
+    if (message_arena != submessage_arena) {
+      device_uuid = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, device_uuid, submessage_arena);
+    }
+    
+  } else {
+    
+  }
+  device_uuid_ = device_uuid;
+  // @@protoc_insertion_point(field_set_allocated:dmi.UploadDebugInfoStatus.device_uuid)
+}
+
+// .dmi.UploadDebugInfoStatus.UploadStatus status = 2;
+inline void UploadDebugInfoStatus::clear_status() {
+  status_ = 0;
+}
+inline ::dmi::UploadDebugInfoStatus_UploadStatus UploadDebugInfoStatus::status() const {
+  // @@protoc_insertion_point(field_get:dmi.UploadDebugInfoStatus.status)
+  return static_cast< ::dmi::UploadDebugInfoStatus_UploadStatus >(status_);
+}
+inline void UploadDebugInfoStatus::set_status(::dmi::UploadDebugInfoStatus_UploadStatus value) {
+  
+  status_ = value;
+  // @@protoc_insertion_point(field_set:dmi.UploadDebugInfoStatus.status)
+}
+
+// int32 percent_uploaded = 3;
+inline void UploadDebugInfoStatus::clear_percent_uploaded() {
+  percent_uploaded_ = 0;
+}
+inline ::google::protobuf::int32 UploadDebugInfoStatus::percent_uploaded() const {
+  // @@protoc_insertion_point(field_get:dmi.UploadDebugInfoStatus.percent_uploaded)
+  return percent_uploaded_;
+}
+inline void UploadDebugInfoStatus::set_percent_uploaded(::google::protobuf::int32 value) {
+  
+  percent_uploaded_ = value;
+  // @@protoc_insertion_point(field_set:dmi.UploadDebugInfoStatus.percent_uploaded)
+}
+
+// .dmi.UploadDebugInfoStatus.Reason reason = 4;
+inline void UploadDebugInfoStatus::clear_reason() {
+  reason_ = 0;
+}
+inline ::dmi::UploadDebugInfoStatus_Reason UploadDebugInfoStatus::reason() const {
+  // @@protoc_insertion_point(field_get:dmi.UploadDebugInfoStatus.reason)
+  return static_cast< ::dmi::UploadDebugInfoStatus_Reason >(reason_);
+}
+inline void UploadDebugInfoStatus::set_reason(::dmi::UploadDebugInfoStatus_Reason value) {
+  
+  reason_ = value;
+  // @@protoc_insertion_point(field_set:dmi.UploadDebugInfoStatus.reason)
+}
+
+// string location_url = 5;
+inline void UploadDebugInfoStatus::clear_location_url() {
+  location_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& UploadDebugInfoStatus::location_url() const {
+  // @@protoc_insertion_point(field_get:dmi.UploadDebugInfoStatus.location_url)
+  return location_url_.GetNoArena();
+}
+inline void UploadDebugInfoStatus::set_location_url(const ::std::string& value) {
+  
+  location_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:dmi.UploadDebugInfoStatus.location_url)
+}
+#if LANG_CXX11
+inline void UploadDebugInfoStatus::set_location_url(::std::string&& value) {
+  
+  location_url_.SetNoArena(
+    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+  // @@protoc_insertion_point(field_set_rvalue:dmi.UploadDebugInfoStatus.location_url)
+}
+#endif
+inline void UploadDebugInfoStatus::set_location_url(const char* value) {
+  GOOGLE_DCHECK(value != nullptr);
+  
+  location_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:dmi.UploadDebugInfoStatus.location_url)
+}
+inline void UploadDebugInfoStatus::set_location_url(const char* value, size_t size) {
+  
+  location_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+      ::std::string(reinterpret_cast<const char*>(value), size));
+  // @@protoc_insertion_point(field_set_pointer:dmi.UploadDebugInfoStatus.location_url)
+}
+inline ::std::string* UploadDebugInfoStatus::mutable_location_url() {
+  
+  // @@protoc_insertion_point(field_mutable:dmi.UploadDebugInfoStatus.location_url)
+  return location_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* UploadDebugInfoStatus::release_location_url() {
+  // @@protoc_insertion_point(field_release:dmi.UploadDebugInfoStatus.location_url)
+  
+  return location_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void UploadDebugInfoStatus::set_allocated_location_url(::std::string* location_url) {
+  if (location_url != nullptr) {
+    
+  } else {
+    
+  }
+  location_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), location_url);
+  // @@protoc_insertion_point(field_set_allocated:dmi.UploadDebugInfoStatus.location_url)
+}
+
+// string file_name = 6;
+inline void UploadDebugInfoStatus::clear_file_name() {
+  file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& UploadDebugInfoStatus::file_name() const {
+  // @@protoc_insertion_point(field_get:dmi.UploadDebugInfoStatus.file_name)
+  return file_name_.GetNoArena();
+}
+inline void UploadDebugInfoStatus::set_file_name(const ::std::string& value) {
+  
+  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:dmi.UploadDebugInfoStatus.file_name)
+}
+#if LANG_CXX11
+inline void UploadDebugInfoStatus::set_file_name(::std::string&& value) {
+  
+  file_name_.SetNoArena(
+    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
+  // @@protoc_insertion_point(field_set_rvalue:dmi.UploadDebugInfoStatus.file_name)
+}
+#endif
+inline void UploadDebugInfoStatus::set_file_name(const char* value) {
+  GOOGLE_DCHECK(value != nullptr);
+  
+  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:dmi.UploadDebugInfoStatus.file_name)
+}
+inline void UploadDebugInfoStatus::set_file_name(const char* value, size_t size) {
+  
+  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+      ::std::string(reinterpret_cast<const char*>(value), size));
+  // @@protoc_insertion_point(field_set_pointer:dmi.UploadDebugInfoStatus.file_name)
+}
+inline ::std::string* UploadDebugInfoStatus::mutable_file_name() {
+  
+  // @@protoc_insertion_point(field_mutable:dmi.UploadDebugInfoStatus.file_name)
+  return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* UploadDebugInfoStatus::release_file_name() {
+  // @@protoc_insertion_point(field_release:dmi.UploadDebugInfoStatus.file_name)
+  
+  return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void UploadDebugInfoStatus::set_allocated_file_name(::std::string* file_name) {
+  if (file_name != nullptr) {
+    
+  } else {
+    
+  }
+  file_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), file_name);
+  // @@protoc_insertion_point(field_set_allocated:dmi.UploadDebugInfoStatus.file_name)
+}
+
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
@@ -1936,6 +2654,10 @@
 
 // -------------------------------------------------------------------
 
+// -------------------------------------------------------------------
+
+// -------------------------------------------------------------------
+
 
 // @@protoc_insertion_point(namespace_scope)
 
@@ -1959,6 +2681,16 @@
 inline const EnumDescriptor* GetEnumDescriptor< ::dmi::StartupConfigInfoResponse_Reason>() {
   return ::dmi::StartupConfigInfoResponse_Reason_descriptor();
 }
+template <> struct is_proto_enum< ::dmi::UploadDebugInfoStatus_UploadStatus> : ::std::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::dmi::UploadDebugInfoStatus_UploadStatus>() {
+  return ::dmi::UploadDebugInfoStatus_UploadStatus_descriptor();
+}
+template <> struct is_proto_enum< ::dmi::UploadDebugInfoStatus_Reason> : ::std::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::dmi::UploadDebugInfoStatus_Reason>() {
+  return ::dmi::UploadDebugInfoStatus_Reason_descriptor();
+}
 
 }  // namespace protobuf
 }  // namespace google
diff --git a/dmi.pb b/dmi.pb
index f11d4a5..6f1f575 100644
--- a/dmi.pb
+++ b/dmi.pb
Binary files differ
diff --git a/go/dmi/sw_management_service.pb.go b/go/dmi/sw_management_service.pb.go
index db176be..fde093c 100644
--- a/go/dmi/sw_management_service.pb.go
+++ b/go/dmi/sw_management_service.pb.go
@@ -126,6 +126,77 @@
 	return fileDescriptor_000929e4bec891d7, []int{6, 0}
 }
 
+type UploadDebugInfoStatus_UploadStatus int32
+
+const (
+	UploadDebugInfoStatus_UNDEFINED_UPLOAD_STATUS UploadDebugInfoStatus_UploadStatus = 0
+	UploadDebugInfoStatus_COMPLETE                UploadDebugInfoStatus_UploadStatus = 1
+	UploadDebugInfoStatus_IN_PROGRESS             UploadDebugInfoStatus_UploadStatus = 2
+	UploadDebugInfoStatus_ERROR                   UploadDebugInfoStatus_UploadStatus = 3
+)
+
+var UploadDebugInfoStatus_UploadStatus_name = map[int32]string{
+	0: "UNDEFINED_UPLOAD_STATUS",
+	1: "COMPLETE",
+	2: "IN_PROGRESS",
+	3: "ERROR",
+}
+
+var UploadDebugInfoStatus_UploadStatus_value = map[string]int32{
+	"UNDEFINED_UPLOAD_STATUS": 0,
+	"COMPLETE":                1,
+	"IN_PROGRESS":             2,
+	"ERROR":                   3,
+}
+
+func (x UploadDebugInfoStatus_UploadStatus) String() string {
+	return proto.EnumName(UploadDebugInfoStatus_UploadStatus_name, int32(x))
+}
+
+func (UploadDebugInfoStatus_UploadStatus) EnumDescriptor() ([]byte, []int) {
+	return fileDescriptor_000929e4bec891d7, []int{8, 0}
+}
+
+type UploadDebugInfoStatus_Reason int32
+
+const (
+	UploadDebugInfoStatus_UNDEFINED_REASON                  UploadDebugInfoStatus_Reason = 0
+	UploadDebugInfoStatus_UNKNOWN_DEVICE                    UploadDebugInfoStatus_Reason = 1
+	UploadDebugInfoStatus_INTERNAL_ERROR                    UploadDebugInfoStatus_Reason = 2
+	UploadDebugInfoStatus_DEVICE_UNREACHABLE                UploadDebugInfoStatus_Reason = 3
+	UploadDebugInfoStatus_REMOTE_LOCATION_UNREACHABLE       UploadDebugInfoStatus_Reason = 4
+	UploadDebugInfoStatus_REMOTE_LOCATION_PERMISSION_DENIED UploadDebugInfoStatus_Reason = 5
+	UploadDebugInfoStatus_ERROR_DURING_UPLOAD               UploadDebugInfoStatus_Reason = 6
+)
+
+var UploadDebugInfoStatus_Reason_name = map[int32]string{
+	0: "UNDEFINED_REASON",
+	1: "UNKNOWN_DEVICE",
+	2: "INTERNAL_ERROR",
+	3: "DEVICE_UNREACHABLE",
+	4: "REMOTE_LOCATION_UNREACHABLE",
+	5: "REMOTE_LOCATION_PERMISSION_DENIED",
+	6: "ERROR_DURING_UPLOAD",
+}
+
+var UploadDebugInfoStatus_Reason_value = map[string]int32{
+	"UNDEFINED_REASON":                  0,
+	"UNKNOWN_DEVICE":                    1,
+	"INTERNAL_ERROR":                    2,
+	"DEVICE_UNREACHABLE":                3,
+	"REMOTE_LOCATION_UNREACHABLE":       4,
+	"REMOTE_LOCATION_PERMISSION_DENIED": 5,
+	"ERROR_DURING_UPLOAD":               6,
+}
+
+func (x UploadDebugInfoStatus_Reason) String() string {
+	return proto.EnumName(UploadDebugInfoStatus_Reason_name, int32(x))
+}
+
+func (UploadDebugInfoStatus_Reason) EnumDescriptor() ([]byte, []int) {
+	return fileDescriptor_000929e4bec891d7, []int{8, 1}
+}
+
 type SoftwareVersionInformation struct {
 	ActiveVersions       []*ImageVersion `protobuf:"bytes,1,rep,name=active_versions,json=activeVersions,proto3" json:"active_versions,omitempty"`
 	StandbyVersions      []*ImageVersion `protobuf:"bytes,2,rep,name=standby_versions,json=standbyVersions,proto3" json:"standby_versions,omitempty"`
@@ -503,10 +574,150 @@
 	return ""
 }
 
+type UploadDebugInfoRequest struct {
+	DeviceUuid *Uuid `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
+	// location_url is the remote location where the information needed for troubleshooting should be uploaded.
+	// Authentication (user/pass) if any should be in the location_url string
+	// The locaion_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the directory
+	// e.g. sftp://upload_user:upload_pass@192.168.0.1:22/hw_debug_info/
+	LocationUrl          string   `protobuf:"bytes,3,opt,name=location_url,json=locationUrl,proto3" json:"location_url,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *UploadDebugInfoRequest) Reset()         { *m = UploadDebugInfoRequest{} }
+func (m *UploadDebugInfoRequest) String() string { return proto.CompactTextString(m) }
+func (*UploadDebugInfoRequest) ProtoMessage()    {}
+func (*UploadDebugInfoRequest) Descriptor() ([]byte, []int) {
+	return fileDescriptor_000929e4bec891d7, []int{7}
+}
+
+func (m *UploadDebugInfoRequest) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_UploadDebugInfoRequest.Unmarshal(m, b)
+}
+func (m *UploadDebugInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_UploadDebugInfoRequest.Marshal(b, m, deterministic)
+}
+func (m *UploadDebugInfoRequest) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_UploadDebugInfoRequest.Merge(m, src)
+}
+func (m *UploadDebugInfoRequest) XXX_Size() int {
+	return xxx_messageInfo_UploadDebugInfoRequest.Size(m)
+}
+func (m *UploadDebugInfoRequest) XXX_DiscardUnknown() {
+	xxx_messageInfo_UploadDebugInfoRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_UploadDebugInfoRequest proto.InternalMessageInfo
+
+func (m *UploadDebugInfoRequest) GetDeviceUuid() *Uuid {
+	if m != nil {
+		return m.DeviceUuid
+	}
+	return nil
+}
+
+func (m *UploadDebugInfoRequest) GetLocationUrl() string {
+	if m != nil {
+		return m.LocationUrl
+	}
+	return ""
+}
+
+// Implementations would be expected to stream multiple UploadDebugInfoStatus indicating the progress of the upload
+type UploadDebugInfoStatus struct {
+	DeviceUuid *Uuid                              `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
+	Status     UploadDebugInfoStatus_UploadStatus `protobuf:"varint,2,opt,name=status,proto3,enum=dmi.UploadDebugInfoStatus_UploadStatus" json:"status,omitempty"`
+	// percent_uploaded is the percentage of the upload that is done
+	// should be a value between 0 and 100 when status is IN_PROGRESS
+	// should be 100 when status is COMPLETE
+	// can be set to -1 if the device manager implementations cannot support
+	// the progress percentage
+	PercentUploaded int32                        `protobuf:"varint,3,opt,name=percent_uploaded,json=percentUploaded,proto3" json:"percent_uploaded,omitempty"`
+	Reason          UploadDebugInfoStatus_Reason `protobuf:"varint,4,opt,name=reason,proto3,enum=dmi.UploadDebugInfoStatus_Reason" json:"reason,omitempty"`
+	LocationUrl     string                       `protobuf:"bytes,5,opt,name=location_url,json=locationUrl,proto3" json:"location_url,omitempty"`
+	// file_name is the file at location_url where the debug information was uploaded.
+	// Implementations need to ensure that file_name is unique at the remote location.
+	FileName             string   `protobuf:"bytes,6,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *UploadDebugInfoStatus) Reset()         { *m = UploadDebugInfoStatus{} }
+func (m *UploadDebugInfoStatus) String() string { return proto.CompactTextString(m) }
+func (*UploadDebugInfoStatus) ProtoMessage()    {}
+func (*UploadDebugInfoStatus) Descriptor() ([]byte, []int) {
+	return fileDescriptor_000929e4bec891d7, []int{8}
+}
+
+func (m *UploadDebugInfoStatus) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_UploadDebugInfoStatus.Unmarshal(m, b)
+}
+func (m *UploadDebugInfoStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_UploadDebugInfoStatus.Marshal(b, m, deterministic)
+}
+func (m *UploadDebugInfoStatus) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_UploadDebugInfoStatus.Merge(m, src)
+}
+func (m *UploadDebugInfoStatus) XXX_Size() int {
+	return xxx_messageInfo_UploadDebugInfoStatus.Size(m)
+}
+func (m *UploadDebugInfoStatus) XXX_DiscardUnknown() {
+	xxx_messageInfo_UploadDebugInfoStatus.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_UploadDebugInfoStatus proto.InternalMessageInfo
+
+func (m *UploadDebugInfoStatus) GetDeviceUuid() *Uuid {
+	if m != nil {
+		return m.DeviceUuid
+	}
+	return nil
+}
+
+func (m *UploadDebugInfoStatus) GetStatus() UploadDebugInfoStatus_UploadStatus {
+	if m != nil {
+		return m.Status
+	}
+	return UploadDebugInfoStatus_UNDEFINED_UPLOAD_STATUS
+}
+
+func (m *UploadDebugInfoStatus) GetPercentUploaded() int32 {
+	if m != nil {
+		return m.PercentUploaded
+	}
+	return 0
+}
+
+func (m *UploadDebugInfoStatus) GetReason() UploadDebugInfoStatus_Reason {
+	if m != nil {
+		return m.Reason
+	}
+	return UploadDebugInfoStatus_UNDEFINED_REASON
+}
+
+func (m *UploadDebugInfoStatus) GetLocationUrl() string {
+	if m != nil {
+		return m.LocationUrl
+	}
+	return ""
+}
+
+func (m *UploadDebugInfoStatus) GetFileName() string {
+	if m != nil {
+		return m.FileName
+	}
+	return ""
+}
+
 func init() {
 	proto.RegisterEnum("dmi.GetSoftwareVersionInformationResponse_Reason", GetSoftwareVersionInformationResponse_Reason_name, GetSoftwareVersionInformationResponse_Reason_value)
 	proto.RegisterEnum("dmi.ConfigResponse_Reason", ConfigResponse_Reason_name, ConfigResponse_Reason_value)
 	proto.RegisterEnum("dmi.StartupConfigInfoResponse_Reason", StartupConfigInfoResponse_Reason_name, StartupConfigInfoResponse_Reason_value)
+	proto.RegisterEnum("dmi.UploadDebugInfoStatus_UploadStatus", UploadDebugInfoStatus_UploadStatus_name, UploadDebugInfoStatus_UploadStatus_value)
+	proto.RegisterEnum("dmi.UploadDebugInfoStatus_Reason", UploadDebugInfoStatus_Reason_name, UploadDebugInfoStatus_Reason_value)
 	proto.RegisterType((*SoftwareVersionInformation)(nil), "dmi.SoftwareVersionInformation")
 	proto.RegisterType((*GetSoftwareVersionInformationResponse)(nil), "dmi.GetSoftwareVersionInformationResponse")
 	proto.RegisterType((*DownloadImageRequest)(nil), "dmi.DownloadImageRequest")
@@ -514,63 +725,79 @@
 	proto.RegisterType((*ConfigResponse)(nil), "dmi.ConfigResponse")
 	proto.RegisterType((*StartupConfigInfoRequest)(nil), "dmi.StartupConfigInfoRequest")
 	proto.RegisterType((*StartupConfigInfoResponse)(nil), "dmi.StartupConfigInfoResponse")
+	proto.RegisterType((*UploadDebugInfoRequest)(nil), "dmi.UploadDebugInfoRequest")
+	proto.RegisterType((*UploadDebugInfoStatus)(nil), "dmi.UploadDebugInfoStatus")
 }
 
 func init() { proto.RegisterFile("dmi/sw_management_service.proto", fileDescriptor_000929e4bec891d7) }
 
 var fileDescriptor_000929e4bec891d7 = []byte{
-	// 804 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xed, 0x6e, 0xe3, 0x44,
-	0x14, 0xc5, 0x71, 0x37, 0x28, 0x37, 0xdb, 0xd6, 0x3b, 0x74, 0x51, 0x1a, 0x54, 0x5a, 0xbc, 0x5a,
-	0xa9, 0x5a, 0x69, 0x93, 0x25, 0xdd, 0x3f, 0xb0, 0x80, 0xe4, 0x8d, 0xdd, 0xd4, 0xa2, 0x38, 0xcb,
-	0xb8, 0x29, 0x62, 0x85, 0x18, 0x4d, 0xe3, 0x49, 0x76, 0xa4, 0xda, 0x13, 0xec, 0x71, 0x0a, 0x2f,
-	0xc2, 0x73, 0xf0, 0x02, 0xfc, 0xe0, 0x05, 0x90, 0x78, 0x23, 0xe4, 0x19, 0x87, 0x90, 0x2f, 0xb4,
-	0xad, 0xd0, 0xfe, 0xb3, 0xef, 0xdc, 0x73, 0x66, 0xe6, 0x9e, 0x7b, 0xcf, 0xc0, 0x61, 0x14, 0xf3,
-	0x76, 0x76, 0x43, 0x62, 0x9a, 0xd0, 0x31, 0x8b, 0x59, 0x22, 0x49, 0xc6, 0xd2, 0x29, 0x1f, 0xb2,
-	0xd6, 0x24, 0x15, 0x52, 0x20, 0x33, 0x8a, 0x79, 0xf3, 0x41, 0x91, 0x35, 0x14, 0x71, 0x2c, 0x92,
-	0x4c, 0xc7, 0x9b, 0xf7, 0x8b, 0xd0, 0x9b, 0x9b, 0xf2, 0x0f, 0x95, 0x34, 0x3c, 0xa6, 0xe3, 0x12,
-	0x69, 0xff, 0x6a, 0x40, 0x33, 0x14, 0x23, 0x79, 0x43, 0x53, 0x76, 0xc9, 0xd2, 0x8c, 0x8b, 0xc4,
-	0x4f, 0x46, 0x22, 0x8d, 0xa9, 0xe4, 0x22, 0x41, 0x9f, 0xc3, 0x2e, 0x1d, 0x4a, 0x3e, 0x65, 0x64,
-	0xaa, 0x17, 0xb3, 0x86, 0x71, 0x64, 0x1e, 0xd7, 0x3b, 0x0f, 0x5a, 0x51, 0xcc, 0x5b, 0x7e, 0xc1,
-	0x54, 0xc2, 0xf0, 0x8e, 0xce, 0x2c, 0x7f, 0x33, 0xf4, 0x05, 0x58, 0x99, 0xa4, 0x49, 0x74, 0xf5,
-	0xcb, 0x1c, 0x5c, 0xd9, 0x04, 0xde, 0x2d, 0x53, 0x67, 0x68, 0xfb, 0xaf, 0x0a, 0x3c, 0xee, 0x31,
-	0xb9, 0xf9, 0x6c, 0x98, 0x65, 0x13, 0x91, 0x64, 0x0c, 0x3d, 0x82, 0x6a, 0x26, 0xa9, 0xcc, 0x8b,
-	0xa3, 0x19, 0xc7, 0x3b, 0x9d, 0xba, 0x62, 0x0f, 0x55, 0x08, 0x97, 0x4b, 0xc8, 0x87, 0x6a, 0xca,
-	0x68, 0x26, 0x92, 0x46, 0x45, 0x25, 0x7d, 0xaa, 0x92, 0xde, 0x6a, 0x83, 0x16, 0x56, 0x40, 0x5c,
-	0x12, 0xa0, 0x13, 0xd8, 0xe2, 0xc9, 0x48, 0x34, 0xcc, 0x23, 0xe3, 0xb8, 0xde, 0x39, 0xd4, 0xbb,
-	0x6d, 0x66, 0x51, 0xc9, 0xe8, 0x11, 0x6c, 0x6b, 0x38, 0x89, 0x98, 0xa4, 0xfc, 0xba, 0xb1, 0x75,
-	0x64, 0x1c, 0xd7, 0xf0, 0x7d, 0x1d, 0x74, 0x55, 0xcc, 0xfe, 0x11, 0xaa, 0x7a, 0x2f, 0xb4, 0x07,
-	0xd6, 0x20, 0x70, 0xbd, 0x53, 0x3f, 0xf0, 0x5c, 0x82, 0x3d, 0x27, 0xec, 0x07, 0xd6, 0x7b, 0x08,
-	0xc1, 0xce, 0x20, 0xf8, 0x3a, 0xe8, 0x7f, 0x17, 0x10, 0xd7, 0xbb, 0xf4, 0xbb, 0x9e, 0x65, 0x14,
-	0x31, 0x3f, 0xb8, 0xf0, 0x70, 0xe0, 0x9c, 0x13, 0x0f, 0xe3, 0x3e, 0xb6, 0x2a, 0xe8, 0x43, 0x40,
-	0x7a, 0x9d, 0x0c, 0x02, 0xec, 0x39, 0xdd, 0x33, 0xe7, 0xe5, 0xb9, 0x67, 0x99, 0xf6, 0xcf, 0xb0,
-	0xe7, 0x8a, 0x9b, 0xe4, 0x5a, 0xd0, 0x48, 0x15, 0x1f, 0xb3, 0x9f, 0x72, 0x96, 0x49, 0xf4, 0x04,
-	0xea, 0x11, 0x2b, 0xda, 0x89, 0xe4, 0x39, 0x8f, 0x54, 0x19, 0xeb, 0x9d, 0x9a, 0xba, 0xd8, 0x20,
-	0xe7, 0x11, 0x06, 0xbd, 0x5a, 0x7c, 0xa3, 0xe7, 0x00, 0xaa, 0x7f, 0x88, 0xaa, 0x41, 0x45, 0xa5,
-	0x3e, 0x9c, 0xeb, 0xf9, 0xef, 0x9b, 0xd7, 0xf8, 0x2c, 0x62, 0xbf, 0x86, 0xed, 0xae, 0x48, 0x46,
-	0x7c, 0x7c, 0x97, 0x2d, 0x0f, 0x00, 0x86, 0x0a, 0x4c, 0xf2, 0xf4, 0x5a, 0x6d, 0x59, 0xc3, 0x35,
-	0x1d, 0x19, 0xa4, 0xd7, 0xf6, 0x1f, 0x15, 0xd8, 0x99, 0x91, 0xdf, 0xa6, 0x25, 0x3a, 0x4b, 0x2d,
-	0xd1, 0x54, 0x49, 0x8b, 0x4c, 0xcb, 0xda, 0xaf, 0xc8, 0x68, 0xae, 0x91, 0xf1, 0x37, 0xe3, 0x7f,
-	0xd2, 0x71, 0x1f, 0x1e, 0xaa, 0x4f, 0x72, 0xea, 0x5d, 0x74, 0xcf, 0xfc, 0xa0, 0x47, 0xba, 0xfd,
-	0xe0, 0xd4, 0xef, 0x59, 0xa6, 0x4e, 0xbf, 0x74, 0xce, 0x7d, 0x77, 0x16, 0xdb, 0x42, 0x9f, 0xc0,
-	0x41, 0xff, 0x95, 0x87, 0x9d, 0x0b, 0xbf, 0x1f, 0x10, 0xe7, 0x1c, 0x7b, 0x8e, 0xfb, 0x3d, 0xf1,
-	0x03, 0xf2, 0x0a, 0xf7, 0x7b, 0xd8, 0x0b, 0x43, 0xeb, 0xde, 0x86, 0xce, 0xa8, 0xda, 0xa7, 0xd0,
-	0x08, 0x25, 0x4d, 0x65, 0x3e, 0xd1, 0xf7, 0x2f, 0x44, 0xbb, 0x83, 0x54, 0xf6, 0xef, 0x15, 0xd8,
-	0x5f, 0x43, 0x74, 0x1b, 0x59, 0xbe, 0x5c, 0x92, 0xe5, 0xf1, 0x2c, 0x69, 0x3d, 0xe9, 0xb2, 0x42,
-	0x8b, 0xcd, 0x62, 0x2e, 0x35, 0x0b, 0x6a, 0xc0, 0xfb, 0xa5, 0x19, 0x95, 0x13, 0x38, 0xfb, 0x5d,
-	0x95, 0xf6, 0xde, 0xbb, 0x9f, 0xd0, 0xce, 0x9f, 0x26, 0x1c, 0x06, 0xb4, 0xb0, 0xd1, 0x99, 0xa3,
-	0x7c, 0xf3, 0x8f, 0xe7, 0x87, 0xda, 0xf2, 0xd1, 0xb7, 0x80, 0x56, 0x7d, 0x0b, 0xed, 0xaa, 0x32,
-	0x9d, 0xd1, 0x34, 0x2a, 0xa2, 0xbe, 0xdb, 0x7c, 0xf2, 0xf6, 0x0e, 0x87, 0xbe, 0x82, 0xed, 0x05,
-	0x63, 0x40, 0xfb, 0x0a, 0xbc, 0xce, 0x2c, 0x9a, 0xd6, 0x7c, 0xd8, 0xb5, 0x72, 0xcf, 0x0c, 0xf4,
-	0x1c, 0xb6, 0x9d, 0xc2, 0xfc, 0xa9, 0x64, 0x1a, 0xbf, 0x72, 0x9a, 0x75, 0xa8, 0x17, 0xb0, 0x87,
-	0xd9, 0x94, 0xa5, 0xf2, 0x42, 0x84, 0xda, 0xfd, 0x6f, 0x01, 0xee, 0x41, 0x73, 0x30, 0x89, 0xa8,
-	0x64, 0x0b, 0x9d, 0x91, 0xa7, 0xfa, 0xdd, 0x42, 0x0b, 0xb3, 0xac, 0x0f, 0xfe, 0xc1, 0x9a, 0xf9,
-	0x7e, 0x66, 0xa0, 0x1f, 0xe0, 0xa3, 0xa2, 0x48, 0x6b, 0x58, 0x8a, 0x4a, 0xa1, 0x83, 0x4d, 0xed,
-	0xa7, 0x49, 0x3f, 0xfe, 0xef, 0xee, 0x7c, 0xf9, 0xe2, 0xf5, 0x67, 0x63, 0x2e, 0xdf, 0xe4, 0x57,
-	0xad, 0xa1, 0x88, 0xdb, 0x62, 0xc2, 0x92, 0xa1, 0x48, 0xa3, 0xb6, 0x1e, 0x99, 0xa7, 0xf3, 0x07,
-	0xfd, 0x29, 0x4f, 0x24, 0x4b, 0x47, 0x74, 0xc8, 0xda, 0xd3, 0x93, 0xf6, 0x58, 0xb4, 0xa3, 0x98,
-	0x5f, 0x55, 0xd5, 0x1b, 0x7d, 0xf2, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdd, 0xa9, 0x07, 0xea,
-	0x00, 0x08, 0x00, 0x00,
+	// 1038 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xeb, 0x4e, 0xe3, 0xc6,
+	0x17, 0x5f, 0xe7, 0xf6, 0xdf, 0x9c, 0x00, 0xf1, 0xce, 0xc2, 0x6e, 0x08, 0xe2, 0x0f, 0x78, 0x85,
+	0x4a, 0x57, 0x5a, 0x42, 0xc3, 0x7e, 0xd9, 0x6e, 0x2f, 0xf2, 0xc6, 0x06, 0xac, 0x06, 0x9b, 0x8e,
+	0x63, 0xaa, 0xae, 0xaa, 0x5a, 0x26, 0x9e, 0x64, 0x2d, 0xc5, 0x76, 0xea, 0x0b, 0xb4, 0x2f, 0xd2,
+	0x4f, 0x7d, 0x88, 0xbe, 0x40, 0x55, 0x55, 0x7d, 0x82, 0xbe, 0x51, 0x35, 0x33, 0x0e, 0x10, 0x27,
+	0x59, 0x2d, 0xa8, 0x55, 0xbf, 0xd9, 0xbf, 0x39, 0x97, 0x99, 0xf3, 0x3b, 0x37, 0xd8, 0x72, 0x7d,
+	0xaf, 0x15, 0x5f, 0xd9, 0xbe, 0x13, 0x38, 0x43, 0xe2, 0x93, 0x20, 0xb1, 0x63, 0x12, 0x5d, 0x7a,
+	0x7d, 0xb2, 0x3f, 0x8e, 0xc2, 0x24, 0x44, 0x45, 0xd7, 0xf7, 0x9a, 0x8f, 0xa8, 0x54, 0x3f, 0xf4,
+	0xfd, 0x30, 0x88, 0x39, 0xde, 0x5c, 0xa2, 0xd0, 0xbb, 0xab, 0xec, 0x0f, 0x65, 0x66, 0x3c, 0xdf,
+	0x19, 0x66, 0x9a, 0xd2, 0xcf, 0x02, 0x34, 0xcd, 0x70, 0x90, 0x5c, 0x39, 0x11, 0x39, 0x27, 0x51,
+	0xec, 0x85, 0x81, 0x16, 0x0c, 0xc2, 0xc8, 0x77, 0x12, 0x2f, 0x0c, 0xd0, 0xa7, 0x50, 0x77, 0xfa,
+	0x89, 0x77, 0x49, 0xec, 0x4b, 0x7e, 0x18, 0x37, 0x84, 0xed, 0xe2, 0x5e, 0xad, 0xfd, 0x68, 0xdf,
+	0xf5, 0xbd, 0x7d, 0x8d, 0x5a, 0xca, 0xd4, 0xf0, 0x0a, 0x97, 0xcc, 0x7e, 0x63, 0xf4, 0x19, 0x88,
+	0x71, 0xe2, 0x04, 0xee, 0xc5, 0x4f, 0x37, 0xca, 0x85, 0x45, 0xca, 0xf5, 0x4c, 0x74, 0xa2, 0x2d,
+	0xfd, 0x55, 0x80, 0xdd, 0x63, 0x92, 0x2c, 0xbe, 0x1b, 0x26, 0xf1, 0x38, 0x0c, 0x62, 0x82, 0x9e,
+	0x41, 0x25, 0x4e, 0x9c, 0x24, 0xa5, 0x57, 0x13, 0xf6, 0x56, 0xda, 0x35, 0x66, 0xdd, 0x64, 0x10,
+	0xce, 0x8e, 0x90, 0x06, 0x95, 0x88, 0x38, 0x71, 0x18, 0x34, 0x0a, 0x4c, 0xe8, 0x13, 0x26, 0xf4,
+	0x41, 0x0e, 0xf6, 0x31, 0x53, 0xc4, 0x99, 0x01, 0x74, 0x08, 0x25, 0x2f, 0x18, 0x84, 0x8d, 0xe2,
+	0xb6, 0xb0, 0x57, 0x6b, 0x6f, 0x71, 0x6f, 0x8b, 0xad, 0x30, 0x61, 0xf4, 0x0c, 0x96, 0xb9, 0xba,
+	0xed, 0x92, 0xc4, 0xf1, 0x46, 0x8d, 0xd2, 0xb6, 0xb0, 0x57, 0xc5, 0x4b, 0x1c, 0x54, 0x18, 0x26,
+	0x7d, 0x0f, 0x15, 0xee, 0x0b, 0xad, 0x82, 0x68, 0xe9, 0x8a, 0x7a, 0xa4, 0xe9, 0xaa, 0x62, 0x63,
+	0x55, 0x36, 0x0d, 0x5d, 0x7c, 0x80, 0x10, 0xac, 0x58, 0xfa, 0x57, 0xba, 0xf1, 0x8d, 0x6e, 0x2b,
+	0xea, 0xb9, 0xd6, 0x51, 0x45, 0x81, 0x62, 0x9a, 0xde, 0x53, 0xb1, 0x2e, 0x77, 0x6d, 0x15, 0x63,
+	0x03, 0x8b, 0x05, 0xf4, 0x04, 0x10, 0x3f, 0xb7, 0x2d, 0x1d, 0xab, 0x72, 0xe7, 0x44, 0x7e, 0xd3,
+	0x55, 0xc5, 0xa2, 0xf4, 0x23, 0xac, 0x2a, 0xe1, 0x55, 0x30, 0x0a, 0x1d, 0x97, 0x05, 0x1f, 0x93,
+	0x1f, 0x52, 0x12, 0x27, 0xe8, 0x39, 0xd4, 0x5c, 0x42, 0xd3, 0xc9, 0x4e, 0x53, 0xcf, 0x65, 0x61,
+	0xac, 0xb5, 0xab, 0xec, 0x61, 0x56, 0xea, 0xb9, 0x18, 0xf8, 0x29, 0xfd, 0x46, 0x2f, 0x01, 0x58,
+	0xfe, 0xd8, 0x2c, 0x06, 0x05, 0x26, 0xba, 0x76, 0xc3, 0xe7, 0xed, 0x97, 0x57, 0xbd, 0x09, 0x22,
+	0xbd, 0x85, 0xe5, 0x4e, 0x18, 0x0c, 0xbc, 0xe1, 0x7d, 0x5c, 0x6e, 0x02, 0xf4, 0x99, 0xb2, 0x9d,
+	0x46, 0x23, 0xe6, 0xb2, 0x8a, 0xab, 0x1c, 0xb1, 0xa2, 0x91, 0xf4, 0x47, 0x01, 0x56, 0x26, 0xc6,
+	0xef, 0x92, 0x12, 0xed, 0x5c, 0x4a, 0x34, 0x99, 0xd0, 0xb4, 0xa5, 0x3c, 0xf7, 0x33, 0x34, 0x16,
+	0xe7, 0xd0, 0xf8, 0xab, 0xf0, 0x0f, 0xf1, 0xb8, 0x0e, 0x6b, 0xec, 0xd3, 0x3e, 0x52, 0x7b, 0x9d,
+	0x13, 0x4d, 0x3f, 0xb6, 0x3b, 0x86, 0x7e, 0xa4, 0x1d, 0x8b, 0x45, 0x2e, 0x7e, 0x2e, 0x77, 0x35,
+	0x65, 0x82, 0x95, 0xd0, 0x0e, 0x6c, 0x1a, 0x67, 0x2a, 0x96, 0x7b, 0x9a, 0xa1, 0xdb, 0x72, 0x17,
+	0xab, 0xb2, 0xf2, 0xad, 0xad, 0xe9, 0xf6, 0x19, 0x36, 0x8e, 0xb1, 0x6a, 0x9a, 0x62, 0x79, 0x41,
+	0x66, 0x54, 0xa4, 0x23, 0x68, 0x98, 0x89, 0x13, 0x25, 0xe9, 0x98, 0xbf, 0x9f, 0x92, 0x76, 0x0f,
+	0xaa, 0xa4, 0xdf, 0x0a, 0xb0, 0x3e, 0xc7, 0xd0, 0x5d, 0x68, 0xf9, 0x3c, 0x47, 0xcb, 0xee, 0x44,
+	0x68, 0xbe, 0xd1, 0x3c, 0x43, 0xd3, 0xc9, 0x52, 0xcc, 0x25, 0x0b, 0x6a, 0xc0, 0xff, 0xb2, 0x66,
+	0x94, 0x55, 0xe0, 0xe4, 0x77, 0x96, 0xda, 0xf2, 0x7f, 0x50, 0xa1, 0x43, 0x78, 0x62, 0x8d, 0x69,
+	0x7d, 0x2a, 0xe4, 0x22, 0xbd, 0x2f, 0x0b, 0x68, 0x07, 0x96, 0x46, 0x61, 0x9f, 0x15, 0xe1, 0xad,
+	0x28, 0xd4, 0x26, 0x18, 0x2d, 0x9a, 0x3f, 0x4b, 0xb0, 0x96, 0xf3, 0xc4, 0x79, 0xb8, 0x93, 0xa3,
+	0x2f, 0xaf, 0x09, 0xe5, 0x5c, 0x7d, 0xc4, 0xc5, 0xe6, 0xd9, 0xcd, 0xd0, 0x1c, 0xd9, 0x1f, 0x83,
+	0x38, 0x26, 0x51, 0x9f, 0x4e, 0xb4, 0x94, 0x9d, 0x13, 0x97, 0xdd, 0xb6, 0x8c, 0xeb, 0x19, 0x6e,
+	0x65, 0x30, 0x7a, 0x75, 0x9d, 0x17, 0x25, 0xe6, 0x6b, 0xe7, 0x3d, 0xbe, 0x72, 0x39, 0x91, 0x8f,
+	0x47, 0x79, 0x26, 0x1e, 0x68, 0x03, 0xaa, 0x03, 0x6f, 0x44, 0xec, 0xc0, 0xf1, 0x49, 0xa3, 0xc2,
+	0xce, 0x1f, 0x52, 0x40, 0x77, 0x7c, 0x22, 0x59, 0xb0, 0x74, 0xfb, 0xf6, 0x68, 0x03, 0x9e, 0xde,
+	0x70, 0x6f, 0x9d, 0x75, 0x0d, 0x59, 0xb1, 0xcd, 0x9e, 0xdc, 0xb3, 0x4c, 0xf1, 0x01, 0x5a, 0x82,
+	0x87, 0x1d, 0xe3, 0xf4, 0xac, 0xab, 0xf6, 0x28, 0xf9, 0x75, 0xa8, 0xdd, 0xae, 0xc0, 0x02, 0xaa,
+	0x42, 0x99, 0x27, 0x41, 0x51, 0xfa, 0x5d, 0xf8, 0x77, 0xb3, 0x09, 0x6d, 0xc1, 0x06, 0x56, 0x4f,
+	0x8d, 0x9e, 0x6a, 0x77, 0x8d, 0x0e, 0x6f, 0x0b, 0xb7, 0x05, 0x4a, 0x68, 0x17, 0x76, 0xf2, 0x02,
+	0x67, 0x2a, 0x3e, 0xd5, 0x4c, 0x93, 0x7e, 0x2a, 0xaa, 0xae, 0xa9, 0x8a, 0x58, 0x46, 0x4f, 0xe1,
+	0x31, 0xef, 0x43, 0x8a, 0x85, 0x69, 0x17, 0xe2, 0x4f, 0x16, 0x2b, 0xed, 0x5f, 0x4a, 0xb0, 0xa5,
+	0x3b, 0x74, 0xea, 0x4f, 0x06, 0xe0, 0xe9, 0xf5, 0x8a, 0x62, 0xf2, 0x0d, 0x05, 0x7d, 0x0d, 0x68,
+	0x76, 0xcc, 0xa2, 0x3a, 0x63, 0xef, 0xc4, 0x89, 0x5c, 0x8a, 0x6a, 0x4a, 0xf3, 0xf9, 0x87, 0x0f,
+	0x64, 0xf4, 0x05, 0x2c, 0x4f, 0xcd, 0x31, 0xb4, 0xce, 0x94, 0xe7, 0xcd, 0xb6, 0xa6, 0x78, 0x33,
+	0x9b, 0x38, 0x7b, 0x07, 0x02, 0x7a, 0x09, 0xcb, 0x32, 0xdd, 0x55, 0x9c, 0x84, 0x70, 0xfd, 0x99,
+	0xdb, 0xcc, 0xd3, 0x7a, 0x0d, 0xab, 0x98, 0x5c, 0x92, 0x28, 0xe9, 0xd1, 0x34, 0xa3, 0xcb, 0xca,
+	0x1d, 0x94, 0x8f, 0xa1, 0x69, 0x8d, 0x5d, 0x27, 0x21, 0x53, 0x8d, 0x2c, 0x8d, 0xf8, 0x9a, 0x85,
+	0xa6, 0x46, 0x0f, 0xbf, 0xf8, 0xe3, 0x39, 0xe3, 0xe8, 0x40, 0x40, 0xdf, 0xc1, 0x06, 0x0d, 0xd2,
+	0x1c, 0x2b, 0x34, 0x52, 0x68, 0x73, 0x51, 0xb7, 0xe4, 0x46, 0xff, 0xff, 0xfe, 0x66, 0x8a, 0xba,
+	0x50, 0xcf, 0x55, 0x14, 0xda, 0x98, 0x57, 0x67, 0x13, 0x7b, 0xcd, 0xc5, 0x45, 0x78, 0x20, 0xbc,
+	0x79, 0xfd, 0xf6, 0xd5, 0xd0, 0x4b, 0xde, 0xa5, 0x17, 0xfb, 0xfd, 0xd0, 0x6f, 0x85, 0x63, 0x12,
+	0xf4, 0xc3, 0xc8, 0x6d, 0xf1, 0x06, 0xf2, 0xe2, 0x66, 0x9b, 0x7d, 0xe1, 0x05, 0x09, 0x89, 0x06,
+	0x4e, 0x9f, 0xb4, 0x2e, 0x0f, 0x5b, 0xc3, 0xb0, 0xe5, 0xfa, 0xde, 0x45, 0x85, 0x2d, 0xa8, 0x87,
+	0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x46, 0xf6, 0xed, 0xb0, 0xfd, 0x0a, 0x00, 0x00,
 }
 
 // Reference imports to suppress errors if they are not otherwise used.
@@ -600,6 +827,8 @@
 	UpdateStartupConfiguration(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (NativeSoftwareManagementService_UpdateStartupConfigurationClient, error)
 	// This API can be used to retrieve information about the current startup configuration that a device is using
 	GetStartupConfigurationInfo(ctx context.Context, in *StartupConfigInfoRequest, opts ...grpc.CallOption) (*StartupConfigInfoResponse, error)
+	// This API can be used to upload to a remote location, information useful for troubleshooting problems on the hardware
+	UploadDebugInfo(ctx context.Context, in *UploadDebugInfoRequest, opts ...grpc.CallOption) (NativeSoftwareManagementService_UploadDebugInfoClient, error)
 }
 
 type nativeSoftwareManagementServiceClient struct {
@@ -756,6 +985,38 @@
 	return out, nil
 }
 
+func (c *nativeSoftwareManagementServiceClient) UploadDebugInfo(ctx context.Context, in *UploadDebugInfoRequest, opts ...grpc.CallOption) (NativeSoftwareManagementService_UploadDebugInfoClient, error) {
+	stream, err := c.cc.NewStream(ctx, &_NativeSoftwareManagementService_serviceDesc.Streams[4], "/dmi.NativeSoftwareManagementService/UploadDebugInfo", opts...)
+	if err != nil {
+		return nil, err
+	}
+	x := &nativeSoftwareManagementServiceUploadDebugInfoClient{stream}
+	if err := x.ClientStream.SendMsg(in); err != nil {
+		return nil, err
+	}
+	if err := x.ClientStream.CloseSend(); err != nil {
+		return nil, err
+	}
+	return x, nil
+}
+
+type NativeSoftwareManagementService_UploadDebugInfoClient interface {
+	Recv() (*UploadDebugInfoStatus, error)
+	grpc.ClientStream
+}
+
+type nativeSoftwareManagementServiceUploadDebugInfoClient struct {
+	grpc.ClientStream
+}
+
+func (x *nativeSoftwareManagementServiceUploadDebugInfoClient) Recv() (*UploadDebugInfoStatus, error) {
+	m := new(UploadDebugInfoStatus)
+	if err := x.ClientStream.RecvMsg(m); err != nil {
+		return nil, err
+	}
+	return m, nil
+}
+
 // NativeSoftwareManagementServiceServer is the server API for NativeSoftwareManagementService service.
 type NativeSoftwareManagementServiceServer interface {
 	// Get the software version information of the Active and Standby images
@@ -773,6 +1034,8 @@
 	UpdateStartupConfiguration(*ConfigRequest, NativeSoftwareManagementService_UpdateStartupConfigurationServer) error
 	// This API can be used to retrieve information about the current startup configuration that a device is using
 	GetStartupConfigurationInfo(context.Context, *StartupConfigInfoRequest) (*StartupConfigInfoResponse, error)
+	// This API can be used to upload to a remote location, information useful for troubleshooting problems on the hardware
+	UploadDebugInfo(*UploadDebugInfoRequest, NativeSoftwareManagementService_UploadDebugInfoServer) error
 }
 
 // UnimplementedNativeSoftwareManagementServiceServer can be embedded to have forward compatible implementations.
@@ -797,6 +1060,9 @@
 func (*UnimplementedNativeSoftwareManagementServiceServer) GetStartupConfigurationInfo(ctx context.Context, req *StartupConfigInfoRequest) (*StartupConfigInfoResponse, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetStartupConfigurationInfo not implemented")
 }
+func (*UnimplementedNativeSoftwareManagementServiceServer) UploadDebugInfo(req *UploadDebugInfoRequest, srv NativeSoftwareManagementService_UploadDebugInfoServer) error {
+	return status.Errorf(codes.Unimplemented, "method UploadDebugInfo not implemented")
+}
 
 func RegisterNativeSoftwareManagementServiceServer(s *grpc.Server, srv NativeSoftwareManagementServiceServer) {
 	s.RegisterService(&_NativeSoftwareManagementService_serviceDesc, srv)
@@ -922,6 +1188,27 @@
 	return interceptor(ctx, in, info, handler)
 }
 
+func _NativeSoftwareManagementService_UploadDebugInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
+	m := new(UploadDebugInfoRequest)
+	if err := stream.RecvMsg(m); err != nil {
+		return err
+	}
+	return srv.(NativeSoftwareManagementServiceServer).UploadDebugInfo(m, &nativeSoftwareManagementServiceUploadDebugInfoServer{stream})
+}
+
+type NativeSoftwareManagementService_UploadDebugInfoServer interface {
+	Send(*UploadDebugInfoStatus) error
+	grpc.ServerStream
+}
+
+type nativeSoftwareManagementServiceUploadDebugInfoServer struct {
+	grpc.ServerStream
+}
+
+func (x *nativeSoftwareManagementServiceUploadDebugInfoServer) Send(m *UploadDebugInfoStatus) error {
+	return x.ServerStream.SendMsg(m)
+}
+
 var _NativeSoftwareManagementService_serviceDesc = grpc.ServiceDesc{
 	ServiceName: "dmi.NativeSoftwareManagementService",
 	HandlerType: (*NativeSoftwareManagementServiceServer)(nil),
@@ -956,6 +1243,11 @@
 			Handler:       _NativeSoftwareManagementService_UpdateStartupConfiguration_Handler,
 			ServerStreams: true,
 		},
+		{
+			StreamName:    "UploadDebugInfo",
+			Handler:       _NativeSoftwareManagementService_UploadDebugInfo_Handler,
+			ServerStreams: true,
+		},
 	},
 	Metadata: "dmi/sw_management_service.proto",
 }
diff --git a/protos/dmi/sw_management_service.proto b/protos/dmi/sw_management_service.proto
index c2901e9..6f4762f 100644
--- a/protos/dmi/sw_management_service.proto
+++ b/protos/dmi/sw_management_service.proto
@@ -82,6 +82,50 @@
     string reason_detail = 5;
 }
 
+message UploadDebugInfoRequest {
+    Uuid device_uuid = 1;
+    // location_url is the remote location where the information needed for troubleshooting should be uploaded.
+    // Authentication (user/pass) if any should be in the location_url string
+    // The locaion_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the directory
+    // e.g. sftp://upload_user:upload_pass@192.168.0.1:22/hw_debug_info/
+    string location_url = 3;
+}
+
+// Implementations would be expected to stream multiple UploadDebugInfoStatus indicating the progress of the upload
+message UploadDebugInfoStatus {
+    Uuid device_uuid = 1;
+
+    enum UploadStatus {
+        UNDEFINED_UPLOAD_STATUS = 0;
+        COMPLETE = 1;
+        IN_PROGRESS = 2;
+        ERROR = 3;
+    }
+
+    UploadStatus status = 2;
+    // percent_uploaded is the percentage of the upload that is done
+    // should be a value between 0 and 100 when status is IN_PROGRESS
+    // should be 100 when status is COMPLETE
+    // can be set to -1 if the device manager implementations cannot support
+    // the progress percentage
+    int32 percent_uploaded = 3;
+
+    enum Reason {
+        UNDEFINED_REASON = 0;
+        UNKNOWN_DEVICE = 1;
+        INTERNAL_ERROR = 2;
+        DEVICE_UNREACHABLE = 3;
+        REMOTE_LOCATION_UNREACHABLE = 4;
+        REMOTE_LOCATION_PERMISSION_DENIED = 5;
+        ERROR_DURING_UPLOAD = 6;
+    }
+    Reason reason = 4; // reason specifies why the status is ERROR
+    string location_url = 5;
+    // file_name is the file at location_url where the debug information was uploaded.
+    // Implementations need to ensure that file_name is unique at the remote location.
+    string file_name = 6;
+}
+
 service NativeSoftwareManagementService {
     // Get the software version information of the Active and Standby images
     rpc GetSoftwareVersion(HardwareID) returns(GetSoftwareVersionInformationResponse);
@@ -104,6 +148,9 @@
     // This API can be used to retrieve information about the current startup configuration that a device is using
     rpc GetStartupConfigurationInfo(StartupConfigInfoRequest) returns(StartupConfigInfoResponse);
 
+    // This API can be used to upload to a remote location, information useful for troubleshooting problems on the hardware
+    rpc UploadDebugInfo(UploadDebugInfoRequest) returns(stream UploadDebugInfoStatus);
+
     // If needed we can add this later
     //rpc SubscribeToEvents() returns (stream );
 }
diff --git a/python/dmi/sw_management_service_pb2.py b/python/dmi/sw_management_service_pb2.py
index e06c03b..e1e4e19 100644
--- a/python/dmi/sw_management_service_pb2.py
+++ b/python/dmi/sw_management_service_pb2.py
@@ -17,7 +17,7 @@
 from dmi import sw_image_pb2 as dmi_dot_sw__image__pb2
 
 
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x64mi/sw_management_service.proto\x12\x03\x64mi\x1a\x11\x64mi/commons.proto\x1a\x0c\x64mi/hw.proto\x1a\x12\x64mi/sw_image.proto\"u\n\x1aSoftwareVersionInformation\x12*\n\x0f\x61\x63tive_versions\x18\x01 \x03(\x0b\x32\x11.dmi.ImageVersion\x12+\n\x10standby_versions\x18\x02 \x03(\x0b\x32\x11.dmi.ImageVersion\"\xad\x02\n%GetSoftwareVersionInformationResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x41\n\x06reason\x18\x02 \x01(\x0e\x32\x31.dmi.GetSoftwareVersionInformationResponse.Reason\x12-\n\x04info\x18\x03 \x01(\x0b\x32\x1f.dmi.SoftwareVersionInformation\x12\x15\n\rreason_detail\x18\x04 \x01(\t\"^\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x16\n\x12\x44\x45VICE_UNREACHABLE\x10\x03\"a\n\x14\x44ownloadImageRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12)\n\nimage_info\x18\x02 \x01(\x0b\x32\x15.dmi.ImageInformation\"C\n\rConfigRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12\x12\n\nconfig_url\x18\x02 \x01(\t\"\xa3\x02\n\x0e\x43onfigResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12*\n\x06reason\x18\x02 \x01(\x0e\x32\x1a.dmi.ConfigResponse.Reason\x12\x15\n\rreason_detail\x18\x03 \x01(\t\"\xb0\x01\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x19\n\x15\x45RROR_FETCHING_CONFIG\x10\x03\x12\x12\n\x0eINVALID_CONFIG\x10\x04\x12!\n\x1dOPERATION_ALREADY_IN_PROGRESS\x10\x05\x12\x16\n\x12\x44\x45VICE_UNREACHABLE\x10\x06\":\n\x18StartupConfigInfoRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\"\x8b\x02\n\x19StartupConfigInfoResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x35\n\x06reason\x18\x02 \x01(\x0e\x32%.dmi.StartupConfigInfoResponse.Reason\x12\x12\n\nconfig_url\x18\x03 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12\x15\n\rreason_detail\x18\x05 \x01(\t\"^\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x16\n\x12\x44\x45VICE_UNREACHABLE\x10\x03\x32\xce\x03\n\x1fNativeSoftwareManagementService\x12Q\n\x12GetSoftwareVersion\x12\x0f.dmi.HardwareID\x1a*.dmi.GetSoftwareVersionInformationResponse\x12>\n\rDownloadImage\x12\x19.dmi.DownloadImageRequest\x1a\x10.dmi.ImageStatus0\x01\x12\x34\n\rActivateImage\x12\x0f.dmi.HardwareID\x1a\x10.dmi.ImageStatus0\x01\x12;\n\x14RevertToStandbyImage\x12\x0f.dmi.HardwareID\x1a\x10.dmi.ImageStatus0\x01\x12G\n\x1aUpdateStartupConfiguration\x12\x12.dmi.ConfigRequest\x1a\x13.dmi.ConfigResponse0\x01\x12\\\n\x1bGetStartupConfigurationInfo\x12\x1d.dmi.StartupConfigInfoRequest\x1a\x1e.dmi.StartupConfigInfoResponseB;Z9github.com/opencord/device-management-interface/v3/go/dmib\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x64mi/sw_management_service.proto\x12\x03\x64mi\x1a\x11\x64mi/commons.proto\x1a\x0c\x64mi/hw.proto\x1a\x12\x64mi/sw_image.proto\"u\n\x1aSoftwareVersionInformation\x12*\n\x0f\x61\x63tive_versions\x18\x01 \x03(\x0b\x32\x11.dmi.ImageVersion\x12+\n\x10standby_versions\x18\x02 \x03(\x0b\x32\x11.dmi.ImageVersion\"\xad\x02\n%GetSoftwareVersionInformationResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x41\n\x06reason\x18\x02 \x01(\x0e\x32\x31.dmi.GetSoftwareVersionInformationResponse.Reason\x12-\n\x04info\x18\x03 \x01(\x0b\x32\x1f.dmi.SoftwareVersionInformation\x12\x15\n\rreason_detail\x18\x04 \x01(\t\"^\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x16\n\x12\x44\x45VICE_UNREACHABLE\x10\x03\"a\n\x14\x44ownloadImageRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12)\n\nimage_info\x18\x02 \x01(\x0b\x32\x15.dmi.ImageInformation\"C\n\rConfigRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12\x12\n\nconfig_url\x18\x02 \x01(\t\"\xa3\x02\n\x0e\x43onfigResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12*\n\x06reason\x18\x02 \x01(\x0e\x32\x1a.dmi.ConfigResponse.Reason\x12\x15\n\rreason_detail\x18\x03 \x01(\t\"\xb0\x01\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x19\n\x15\x45RROR_FETCHING_CONFIG\x10\x03\x12\x12\n\x0eINVALID_CONFIG\x10\x04\x12!\n\x1dOPERATION_ALREADY_IN_PROGRESS\x10\x05\x12\x16\n\x12\x44\x45VICE_UNREACHABLE\x10\x06\":\n\x18StartupConfigInfoRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\"\x8b\x02\n\x19StartupConfigInfoResponse\x12\x1b\n\x06status\x18\x01 \x01(\x0e\x32\x0b.dmi.Status\x12\x35\n\x06reason\x18\x02 \x01(\x0e\x32%.dmi.StartupConfigInfoResponse.Reason\x12\x12\n\nconfig_url\x18\x03 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12\x15\n\rreason_detail\x18\x05 \x01(\t\"^\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x16\n\x12\x44\x45VICE_UNREACHABLE\x10\x03\"N\n\x16UploadDebugInfoRequest\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12\x14\n\x0clocation_url\x18\x03 \x01(\t\"\xff\x03\n\x15UploadDebugInfoStatus\x12\x1e\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\t.dmi.Uuid\x12\x37\n\x06status\x18\x02 \x01(\x0e\x32\'.dmi.UploadDebugInfoStatus.UploadStatus\x12\x18\n\x10percent_uploaded\x18\x03 \x01(\x05\x12\x31\n\x06reason\x18\x04 \x01(\x0e\x32!.dmi.UploadDebugInfoStatus.Reason\x12\x14\n\x0clocation_url\x18\x05 \x01(\t\x12\x11\n\tfile_name\x18\x06 \x01(\t\"U\n\x0cUploadStatus\x12\x1b\n\x17UNDEFINED_UPLOAD_STATUS\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\x0f\n\x0bIN_PROGRESS\x10\x02\x12\t\n\x05\x45RROR\x10\x03\"\xbf\x01\n\x06Reason\x12\x14\n\x10UNDEFINED_REASON\x10\x00\x12\x12\n\x0eUNKNOWN_DEVICE\x10\x01\x12\x12\n\x0eINTERNAL_ERROR\x10\x02\x12\x16\n\x12\x44\x45VICE_UNREACHABLE\x10\x03\x12\x1f\n\x1bREMOTE_LOCATION_UNREACHABLE\x10\x04\x12%\n!REMOTE_LOCATION_PERMISSION_DENIED\x10\x05\x12\x17\n\x13\x45RROR_DURING_UPLOAD\x10\x06\x32\x9c\x04\n\x1fNativeSoftwareManagementService\x12Q\n\x12GetSoftwareVersion\x12\x0f.dmi.HardwareID\x1a*.dmi.GetSoftwareVersionInformationResponse\x12>\n\rDownloadImage\x12\x19.dmi.DownloadImageRequest\x1a\x10.dmi.ImageStatus0\x01\x12\x34\n\rActivateImage\x12\x0f.dmi.HardwareID\x1a\x10.dmi.ImageStatus0\x01\x12;\n\x14RevertToStandbyImage\x12\x0f.dmi.HardwareID\x1a\x10.dmi.ImageStatus0\x01\x12G\n\x1aUpdateStartupConfiguration\x12\x12.dmi.ConfigRequest\x1a\x13.dmi.ConfigResponse0\x01\x12\\\n\x1bGetStartupConfigurationInfo\x12\x1d.dmi.StartupConfigInfoRequest\x1a\x1e.dmi.StartupConfigInfoResponse\x12L\n\x0fUploadDebugInfo\x12\x1b.dmi.UploadDebugInfoRequest\x1a\x1a.dmi.UploadDebugInfoStatus0\x01\x42;Z9github.com/opencord/device-management-interface/v3/go/dmib\x06proto3')
 
 
 
@@ -28,9 +28,13 @@
 _CONFIGRESPONSE = DESCRIPTOR.message_types_by_name['ConfigResponse']
 _STARTUPCONFIGINFOREQUEST = DESCRIPTOR.message_types_by_name['StartupConfigInfoRequest']
 _STARTUPCONFIGINFORESPONSE = DESCRIPTOR.message_types_by_name['StartupConfigInfoResponse']
+_UPLOADDEBUGINFOREQUEST = DESCRIPTOR.message_types_by_name['UploadDebugInfoRequest']
+_UPLOADDEBUGINFOSTATUS = DESCRIPTOR.message_types_by_name['UploadDebugInfoStatus']
 _GETSOFTWAREVERSIONINFORMATIONRESPONSE_REASON = _GETSOFTWAREVERSIONINFORMATIONRESPONSE.enum_types_by_name['Reason']
 _CONFIGRESPONSE_REASON = _CONFIGRESPONSE.enum_types_by_name['Reason']
 _STARTUPCONFIGINFORESPONSE_REASON = _STARTUPCONFIGINFORESPONSE.enum_types_by_name['Reason']
+_UPLOADDEBUGINFOSTATUS_UPLOADSTATUS = _UPLOADDEBUGINFOSTATUS.enum_types_by_name['UploadStatus']
+_UPLOADDEBUGINFOSTATUS_REASON = _UPLOADDEBUGINFOSTATUS.enum_types_by_name['Reason']
 SoftwareVersionInformation = _reflection.GeneratedProtocolMessageType('SoftwareVersionInformation', (_message.Message,), {
   'DESCRIPTOR' : _SOFTWAREVERSIONINFORMATION,
   '__module__' : 'dmi.sw_management_service_pb2'
@@ -80,6 +84,20 @@
   })
 _sym_db.RegisterMessage(StartupConfigInfoResponse)
 
+UploadDebugInfoRequest = _reflection.GeneratedProtocolMessageType('UploadDebugInfoRequest', (_message.Message,), {
+  'DESCRIPTOR' : _UPLOADDEBUGINFOREQUEST,
+  '__module__' : 'dmi.sw_management_service_pb2'
+  # @@protoc_insertion_point(class_scope:dmi.UploadDebugInfoRequest)
+  })
+_sym_db.RegisterMessage(UploadDebugInfoRequest)
+
+UploadDebugInfoStatus = _reflection.GeneratedProtocolMessageType('UploadDebugInfoStatus', (_message.Message,), {
+  'DESCRIPTOR' : _UPLOADDEBUGINFOSTATUS,
+  '__module__' : 'dmi.sw_management_service_pb2'
+  # @@protoc_insertion_point(class_scope:dmi.UploadDebugInfoStatus)
+  })
+_sym_db.RegisterMessage(UploadDebugInfoStatus)
+
 _NATIVESOFTWAREMANAGEMENTSERVICE = DESCRIPTOR.services_by_name['NativeSoftwareManagementService']
 if _descriptor._USE_C_DESCRIPTORS == False:
 
@@ -105,6 +123,14 @@
   _STARTUPCONFIGINFORESPONSE._serialized_end=1306
   _STARTUPCONFIGINFORESPONSE_REASON._serialized_start=420
   _STARTUPCONFIGINFORESPONSE_REASON._serialized_end=514
-  _NATIVESOFTWAREMANAGEMENTSERVICE._serialized_start=1309
-  _NATIVESOFTWAREMANAGEMENTSERVICE._serialized_end=1771
+  _UPLOADDEBUGINFOREQUEST._serialized_start=1308
+  _UPLOADDEBUGINFOREQUEST._serialized_end=1386
+  _UPLOADDEBUGINFOSTATUS._serialized_start=1389
+  _UPLOADDEBUGINFOSTATUS._serialized_end=1900
+  _UPLOADDEBUGINFOSTATUS_UPLOADSTATUS._serialized_start=1621
+  _UPLOADDEBUGINFOSTATUS_UPLOADSTATUS._serialized_end=1706
+  _UPLOADDEBUGINFOSTATUS_REASON._serialized_start=1709
+  _UPLOADDEBUGINFOSTATUS_REASON._serialized_end=1900
+  _NATIVESOFTWAREMANAGEMENTSERVICE._serialized_start=1903
+  _NATIVESOFTWAREMANAGEMENTSERVICE._serialized_end=2443
 # @@protoc_insertion_point(module_scope)
diff --git a/python/dmi/sw_management_service_pb2_grpc.py b/python/dmi/sw_management_service_pb2_grpc.py
index cf2398d..1e08155 100644
--- a/python/dmi/sw_management_service_pb2_grpc.py
+++ b/python/dmi/sw_management_service_pb2_grpc.py
@@ -46,6 +46,11 @@
                 request_serializer=dmi_dot_sw__management__service__pb2.StartupConfigInfoRequest.SerializeToString,
                 response_deserializer=dmi_dot_sw__management__service__pb2.StartupConfigInfoResponse.FromString,
                 )
+        self.UploadDebugInfo = channel.unary_stream(
+                '/dmi.NativeSoftwareManagementService/UploadDebugInfo',
+                request_serializer=dmi_dot_sw__management__service__pb2.UploadDebugInfoRequest.SerializeToString,
+                response_deserializer=dmi_dot_sw__management__service__pb2.UploadDebugInfoStatus.FromString,
+                )
 
 
 class NativeSoftwareManagementServiceServicer(object):
@@ -96,6 +101,13 @@
         context.set_details('Method not implemented!')
         raise NotImplementedError('Method not implemented!')
 
+    def UploadDebugInfo(self, request, context):
+        """This API can be used to upload to a remote location, information useful for troubleshooting problems on the hardware
+        """
+        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+        context.set_details('Method not implemented!')
+        raise NotImplementedError('Method not implemented!')
+
 
 def add_NativeSoftwareManagementServiceServicer_to_server(servicer, server):
     rpc_method_handlers = {
@@ -129,6 +141,11 @@
                     request_deserializer=dmi_dot_sw__management__service__pb2.StartupConfigInfoRequest.FromString,
                     response_serializer=dmi_dot_sw__management__service__pb2.StartupConfigInfoResponse.SerializeToString,
             ),
+            'UploadDebugInfo': grpc.unary_stream_rpc_method_handler(
+                    servicer.UploadDebugInfo,
+                    request_deserializer=dmi_dot_sw__management__service__pb2.UploadDebugInfoRequest.FromString,
+                    response_serializer=dmi_dot_sw__management__service__pb2.UploadDebugInfoStatus.SerializeToString,
+            ),
     }
     generic_handler = grpc.method_handlers_generic_handler(
             'dmi.NativeSoftwareManagementService', rpc_method_handlers)
@@ -240,3 +257,20 @@
             dmi_dot_sw__management__service__pb2.StartupConfigInfoResponse.FromString,
             options, channel_credentials,
             insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+    @staticmethod
+    def UploadDebugInfo(request,
+            target,
+            options=(),
+            channel_credentials=None,
+            call_credentials=None,
+            insecure=False,
+            compression=None,
+            wait_for_ready=None,
+            timeout=None,
+            metadata=None):
+        return grpc.experimental.unary_stream(request, target, '/dmi.NativeSoftwareManagementService/UploadDebugInfo',
+            dmi_dot_sw__management__service__pb2.UploadDebugInfoRequest.SerializeToString,
+            dmi_dot_sw__management__service__pb2.UploadDebugInfoStatus.FromString,
+            options, channel_credentials,
+            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
