forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure Monitor Ingestion: Upgrade to stable service version and update…
… client APIs (Azure#33371) * update api * Update API, tests and samples * Upgrade to latest stable API version * async error handling sample
- Loading branch information
Showing
44 changed files
with
1,662 additions
and
755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
233 changes: 105 additions & 128 deletions
233
...monitor-ingestion/src/main/java/com/azure/monitor/ingestion/LogsIngestionAsyncClient.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...estion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.monitor.ingestion.implementation; | ||
|
||
import java.util.List; | ||
|
||
public class LogsIngestionRequest { | ||
|
||
private final List<Object> logs; | ||
private final byte[] requestBody; | ||
|
||
public LogsIngestionRequest(List<Object> logs, byte[] requestBody) { | ||
this.logs = logs; | ||
this.requestBody = requestBody; | ||
} | ||
|
||
public List<Object> getLogs() { | ||
return logs; | ||
} | ||
|
||
public byte[] getRequestBody() { | ||
return requestBody; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...nitor-ingestion/src/main/java/com/azure/monitor/ingestion/models/UploadLogsException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.monitor.ingestion.models; | ||
|
||
import com.azure.core.exception.AzureException; | ||
import com.azure.core.exception.HttpResponseException; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* An aggregate exception containing all inner exceptions that were caused from uploading logs. | ||
*/ | ||
public class UploadLogsException extends AzureException { | ||
/** | ||
* Total count of all logs that were not uploaded to Azure Monitor due to errors. | ||
*/ | ||
private final long failedLogsCount; | ||
/** | ||
* A list of all HTTP errors that occured when uploading logs to Azure Monitor service. | ||
*/ | ||
private final List<HttpResponseException> uploadLogsErrors; | ||
|
||
/** | ||
* Creates an instance of {@link UploadLogsException}. | ||
* @param uploadLogsErrors list of all HTTP response exceptions. | ||
* @param failedLogsCount the total number of logs that failed to upload. | ||
*/ | ||
public UploadLogsException(List<HttpResponseException> uploadLogsErrors, long failedLogsCount) { | ||
this.uploadLogsErrors = uploadLogsErrors; | ||
this.failedLogsCount = failedLogsCount; | ||
} | ||
|
||
/** | ||
* Returns the list of all HTTP response exceptions. | ||
* @return The list of all errors. | ||
*/ | ||
public List<HttpResponseException> getUploadLogsErrors() { | ||
return this.uploadLogsErrors; | ||
} | ||
|
||
/** | ||
* Returns the total number for logs that failed to upload. | ||
* @return the total number of logs that failed to upload. | ||
*/ | ||
public long getFailedLogsCount() { | ||
return failedLogsCount; | ||
} | ||
} |
Oops, something went wrong.