code: func (a *Agent) EnableServiceMaintenance(serviceID, reason, token string) error {
  	service, ok := a.State.Services()[serviceID]
  	if !ok {
  		return fmt.Errorf("No service registered with ID %q", serviceID)
  	}
  
  	// Check if maintenance mode is not already enabled
  	checkID := serviceMaintCheckID(serviceID)
  	if _, ok := a.State.Checks()[checkID]; ok {
  		return nil
  	}
  
  	// Use default notes if no reason provided
  	if reason == "" {
  		reason = defaultServiceMaintReason
  	}
  
  	// Create and register the critical health check
  	check := &structs.HealthCheck{
  		Node:        a.config.NodeName,
  		CheckID:     checkID,
  		Name:        "Service Maintenance Mode",
  		Notes:       reason,
  		ServiceID:   service.ID,
  		ServiceName: service.Service,
  		Status:      api.HealthCritical,
  	}
  	a.AddCheck(check, nil, true, token, ConfigSourceLocal)
  	a.logger.Printf("[INFO] agent: Service %q entered maintenance mode", serviceID)
  
  	return nil
  }
docs: // EnableServiceMaintenance will register a false health check against the given
  // service ID with critical status. This will exclude the service from queries.