code: def collect_diagnostic_data_45(self, end_datetime, bundle_size_bytes, cluster_name=None,
                                   roles=None, collect_metrics=False, start_datetime=None):
      
      args = {
          'endTime': end_datetime.isoformat(),
          'bundleSizeBytes': bundle_size_bytes,
          'clusterName': cluster_name
      }
      if self._get_resource_root().version >= 10:
        args['roles'] = roles
      if self._get_resource_root().version >= 13:
        args['enableMonitorMetricsCollection'] = collect_metrics
        if start_datetime is not None:
            args['startTime'] = start_datetime.isoformat()
      return self._cmd('collectDiagnosticData', data=args)
docs: Issue the command to collect diagnostic data.
      If start_datetime is specified, diagnostic data is collected for the entire period between
      start_datetime and end_datetime provided that bundle size is less than or equal to
      bundle_size_bytes. Diagnostics data collection fails if the bundle size is greater than
      bundle_size_bytes.
  
      If start_datetime is not specified, diagnostic data is collected starting from end_datetime
      and collecting backwards upto a maximum of bundle_size_bytes.
  
      @param end_datetime: The end of the collection period. Type datetime.
      @param bundle_size_bytes: The target size for the support bundle in bytes
      @param cluster_name: The cluster to collect or None for all clusters
      @param roles: Role ids of roles to restrict log and metric collection to. Valid since v10.
      @param collect_metrics: Whether to collect metrics for viewing as charts. Valid since v13.
      @param start_datetime: The start of the collection period. Type datetime. Valid since v13.