Provisioning
Overview
Mecha-Agent handles the setup and configuration of Mecha Machines, ensuring they are ready for operation with minimal manual intervention.
Configure
# settings.yml
provisioning:
  server_url: http://localhost:3000
  cert_sign_url: /v1/provisioning/cert/sign
  paths:
    machine:
      private_key: ~/.mecha/openssl/ecdsa/key.pem
      csr: ~/.mecha/openssl/ecdsa/csr.pem
      cert: ~/.mecha/agent/certs/machine.pem
    server:
      cert: ~/.mecha/agent/certs/server.pem
    ca_bundle:
      cert: ~/.mecha/agent/certs/ca_bundle.pem
    root:
      cert: ~/.mecha/agent/certs/root.pem
Service Architecture
The service is composed of the following components:
- Provisioning Agent: Handles the setup and configuration of machines.
 - Certificate Authority (CA): Issues and manages certificates.
 - API Gateway: Facilitates communication between clients and the service.
 
Agent Task
Grpc Protos
- Ping
- Description: Checks the connectivity status between the client and the server.
 - Request:
 
 
message PingRequest {}
- Response:
 
message PingResponse {
	string code = 1;
	string message = 2;
}
- Usage: Ensures that the server is reachable and responsive before proceeding with further provisioning steps.
 
- Generate Code
- Description: Generates a unique code required for the provisioning process.
 - Request:
 
 
message GenerateCodeRequest {}
- Response:
 
message GenerateCodeResponse {
  string code = 1;
}
- Usage: The generated code is used to securely identify and authenticate the machine during the provisioning process.
 
- Provision by Code
- Description: Provisions the machine using the code generated by the 
Generate Codefunction. - Request:
 
 - Description: Provisions the machine using the code generated by the 
 
message ProvisioningRequest {
  string code = 1;
}
- Response:
 
message ProvisioningStatusResponse {
  bool success = 1;
}
- Usage: Completes the provisioning process by configuring the machine with the necessary settings and credentials.