-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement/osis 145 disable get usage api #139
Conversation
90bc170
to
cc383dc
Compare
// HttpURLConnection connection = null; | ||
// try { | ||
// // check if Utapi Endpoint is reachable | ||
// connection = (HttpURLConnection) new java.net.URL(appEnv.getUtapiEndpoint()).openConnection(); | ||
// connection.setConnectTimeout(appEnv.getUtapiHealthCheckTimeout()); | ||
// connection.connect(); | ||
// } catch (SocketTimeoutException e) { | ||
// logger.warn("Failed to connect to Utapi endpoint {} in timeout {}",appEnv.getUtapiEndpoint(), appEnv.getUtapiHealthCheckTimeout()); | ||
// return Health.down() | ||
// .withDetail("error", e.getMessage()) | ||
// .build(); | ||
// } catch (IOException e) { | ||
// logger.warn("an I/O error occurs while trying to connect {}.",appEnv.getUtapiEndpoint()); | ||
// return Health.down() | ||
// .withDetail("error", e.getMessage()) | ||
// .build(); | ||
// } finally { | ||
// if (connection != null) { | ||
// connection.disconnect(); | ||
// } | ||
// } | ||
return Health.down().build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be refactored in the future as there are some edge cases where not setting the right configuration causes unexpected issues. Hence even if this is not callable as we commented code below, we have commented this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just delete it, as it stays in the git history forever?
// HttpURLConnection connection = null; | ||
// try { | ||
// // check if Utapi Endpoint is reachable | ||
// connection = (HttpURLConnection) new java.net.URL(appEnv.getUtapiEndpoint()).openConnection(); | ||
// connection.setConnectTimeout(appEnv.getUtapiHealthCheckTimeout()); | ||
// connection.connect(); | ||
// } catch (SocketTimeoutException e) { | ||
// logger.warn("Failed to connect to Utapi endpoint {} in timeout {}",appEnv.getUtapiEndpoint(), appEnv.getUtapiHealthCheckTimeout()); | ||
// return Health.down() | ||
// .withDetail("error", e.getMessage()) | ||
// .build(); | ||
// } catch (IOException e) { | ||
// logger.warn("an I/O error occurs while trying to connect {}.",appEnv.getUtapiEndpoint()); | ||
// return Health.down() | ||
// .withDetail("error", e.getMessage()) | ||
// .build(); | ||
// } finally { | ||
// if (connection != null) { | ||
// connection.disconnect(); | ||
// } | ||
// } | ||
return Health.down().build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just delete it, as it stays in the git history forever?
@@ -1 +1 @@ | |||
* @scality/object-lead @XinLiScality |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
* @scality/object-lead @XinLiScality | |
* @scality/object-lead @XinLiScality |
build.gradle
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the commit message say 2.2.2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it should, I will amend it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
cc383dc
to
2932e33
Compare
@williamlardierI removed the commented code in intermediate fix up commit 319f6e4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
GetUsage API is disabled to unblock RING v9.3 release.
Removed Xin as she is not a part of Scality and changed lead group to object. We still have branch protection rules in place for main branch. This rule does not allow any merges without 2 approvals.
2932e33
to
55c9125
Compare
PR Summary: Modification of
getUsage
API BehaviorChanges Introduced:
getUsage
API to consistently return aNotImplemented
status, regardless of UTAPI enablement. This ensures uniformity in API responses and decouples the behavior from UTAPI's operational state.Implications:
Federation Impact:
Code and Output Samples:
getUsage
API now returns the following output:getInfo
API'snot_implemented
list now includesgetUsage
:Generated by Copilot:
This pull request includes various changes to different files in the codebase. The most important changes are as follows:
osis-app/src/main/java/com/scality/osis/healthcheck/UtapiHealthIndicator.java
: Modified the health check for the Utapi endpoint in theUtapiHealthIndicator
class to always return "down" regardless of the actual health of the endpoint.osis-core/src/test/java/com/scality/osis/service/impl/ScalityOsisServiceMiscTests.java
: Added a new test method, commented out and disabled existing test methods, and added the@Disabled
annotation to disable all test methods temporarily.osis-core/src/main/java/com/scality/osis/model/ScalityOsisConstants.java
: Added usage api to the not implemented listosis-app/src/main/java/com/scality/osis/resource/ScalityOsisController.java
: Temporarily disabled thegetUsage
API method in theScalityOsisController
class by annotating it with@NotImplement
and replacing the implementation with aNotImplementedException
. This change will be reverted in a future update in S3C-8266osis-core/src/main/java/com/scality/osis/service/impl/ScalityOsisServiceImpl.java
: Commented out thegetOsisUsage
method inScalityOsisServiceImpl.java
and replaced it with athrow new NotImplementedException();
statement, rendering the method non-functional and always throwing an exception.