Class DiagnosticSettings

java.lang.Object
com.azure.resourcemanager.monitor.fluent.models.DiagnosticSettings
All Implemented Interfaces:
com.azure.json.JsonSerializable<DiagnosticSettings>

public final class DiagnosticSettings extends Object implements com.azure.json.JsonSerializable<DiagnosticSettings>
The diagnostic settings.
  • Constructor Details

    • DiagnosticSettings

      public DiagnosticSettings()
      Creates an instance of DiagnosticSettings class.
  • Method Details

    • storageAccountId

      public String storageAccountId()
      Get the storageAccountId property: The resource ID of the storage account to which you would like to send Diagnostic Logs.
      Returns:
      the storageAccountId value.
    • withStorageAccountId

      public DiagnosticSettings withStorageAccountId(String storageAccountId)
      Set the storageAccountId property: The resource ID of the storage account to which you would like to send Diagnostic Logs.
      Parameters:
      storageAccountId - the storageAccountId value to set.
      Returns:
      the DiagnosticSettings object itself.
    • serviceBusRuleId

      public String serviceBusRuleId()
      Get the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
      Returns:
      the serviceBusRuleId value.
    • withServiceBusRuleId

      public DiagnosticSettings withServiceBusRuleId(String serviceBusRuleId)
      Set the serviceBusRuleId property: The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
      Parameters:
      serviceBusRuleId - the serviceBusRuleId value to set.
      Returns:
      the DiagnosticSettings object itself.
    • eventHubAuthorizationRuleId

      public String eventHubAuthorizationRuleId()
      Get the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule.
      Returns:
      the eventHubAuthorizationRuleId value.
    • withEventHubAuthorizationRuleId

      public DiagnosticSettings withEventHubAuthorizationRuleId(String eventHubAuthorizationRuleId)
      Set the eventHubAuthorizationRuleId property: The resource Id for the event hub authorization rule.
      Parameters:
      eventHubAuthorizationRuleId - the eventHubAuthorizationRuleId value to set.
      Returns:
      the DiagnosticSettings object itself.
    • eventHubName

      public String eventHubName()
      Get the eventHubName property: The name of the event hub. If none is specified, the default event hub will be selected.
      Returns:
      the eventHubName value.
    • withEventHubName

      public DiagnosticSettings withEventHubName(String eventHubName)
      Set the eventHubName property: The name of the event hub. If none is specified, the default event hub will be selected.
      Parameters:
      eventHubName - the eventHubName value to set.
      Returns:
      the DiagnosticSettings object itself.
    • metrics

      public List<MetricSettings> metrics()
      Get the metrics property: The list of metric settings.
      Returns:
      the metrics value.
    • withMetrics

      public DiagnosticSettings withMetrics(List<MetricSettings> metrics)
      Set the metrics property: The list of metric settings.
      Parameters:
      metrics - the metrics value to set.
      Returns:
      the DiagnosticSettings object itself.
    • logs

      public List<LogSettings> logs()
      Get the logs property: The list of logs settings.
      Returns:
      the logs value.
    • withLogs

      public DiagnosticSettings withLogs(List<LogSettings> logs)
      Set the logs property: The list of logs settings.
      Parameters:
      logs - the logs value to set.
      Returns:
      the DiagnosticSettings object itself.
    • workspaceId

      public String workspaceId()
      Get the workspaceId property: The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2.
      Returns:
      the workspaceId value.
    • withWorkspaceId

      public DiagnosticSettings withWorkspaceId(String workspaceId)
      Set the workspaceId property: The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2.
      Parameters:
      workspaceId - the workspaceId value to set.
      Returns:
      the DiagnosticSettings object itself.
    • marketplacePartnerId

      public String marketplacePartnerId()
      Get the marketplacePartnerId property: The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.
      Returns:
      the marketplacePartnerId value.
    • withMarketplacePartnerId

      public DiagnosticSettings withMarketplacePartnerId(String marketplacePartnerId)
      Set the marketplacePartnerId property: The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.
      Parameters:
      marketplacePartnerId - the marketplacePartnerId value to set.
      Returns:
      the DiagnosticSettings object itself.
    • logAnalyticsDestinationType

      public String logAnalyticsDestinationType()
      Get the logAnalyticsDestinationType property: A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: <normalized service identity>_<normalized category name>. Possible values are: Dedicated and null (null is default.).
      Returns:
      the logAnalyticsDestinationType value.
    • withLogAnalyticsDestinationType

      public DiagnosticSettings withLogAnalyticsDestinationType(String logAnalyticsDestinationType)
      Set the logAnalyticsDestinationType property: A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: <normalized service identity>_<normalized category name>. Possible values are: Dedicated and null (null is default.).
      Parameters:
      logAnalyticsDestinationType - the logAnalyticsDestinationType value to set.
      Returns:
      the DiagnosticSettings object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<DiagnosticSettings>
      Throws:
      IOException
    • fromJson

      public static DiagnosticSettings fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of DiagnosticSettings from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of DiagnosticSettings if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the DiagnosticSettings.