Skip to content
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

Add No content status code #21655

Merged
merged 4 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
import io.airbyte.server.handlers.SchedulerHandler;
import io.micronaut.context.annotation.Context;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand Down Expand Up @@ -89,6 +91,7 @@ public ConnectionRead getConnection(@Body final ConnectionIdRequestBody connecti

@Override
@Post(uri = "/delete")
@Status(HttpStatus.NO_CONTENT)
@Secured({EDITOR})
public void deleteConnection(@Body final ConnectionIdRequestBody connectionIdRequestBody) {
ApiHelper.execute(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import io.airbyte.server.handlers.DestinationHandler;
import io.airbyte.server.handlers.SchedulerHandler;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand Down Expand Up @@ -70,6 +72,7 @@ public DestinationRead createDestination(@Body final DestinationCreate destinati
@Post(uri = "/delete")
@Secured({EDITOR})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteDestination(@Body final DestinationIdRequestBody destinationIdRequestBody) {
ApiHelper.execute(() -> {
destinationHandler.deleteDestination(destinationIdRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
import io.airbyte.server.handlers.DestinationDefinitionsHandler;
import io.micronaut.context.annotation.Context;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand All @@ -50,6 +52,7 @@ public DestinationDefinitionRead createCustomDestinationDefinition(final CustomD
@Post(uri = "/delete")
@Secured({ADMIN})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteDestinationDefinition(final DestinationDefinitionIdRequestBody destinationDefinitionIdRequestBody) {
ApiHelper.execute(() -> {
destinationDefinitionsHandler.deleteDestinationDefinition(destinationDefinitionIdRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import io.airbyte.api.model.generated.OperatorConfiguration;
import io.airbyte.server.handlers.OperationsHandler;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand Down Expand Up @@ -54,6 +56,7 @@ public OperationRead createOperation(@Body final OperationCreate operationCreate
@Post("/delete")
@Secured({EDITOR})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteOperation(@Body final OperationIdRequestBody operationIdRequestBody) {
ApiHelper.execute(() -> {
operationsHandler.deleteOperation(operationIdRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
import io.airbyte.server.handlers.SchedulerHandler;
import io.airbyte.server.handlers.SourceHandler;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand Down Expand Up @@ -72,6 +74,7 @@ public SourceRead createSource(final SourceCreate sourceCreate) {
@Post("/delete")
@Secured({EDITOR})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteSource(final SourceIdRequestBody sourceIdRequestBody) {
ApiHelper.execute(() -> {
sourceHandler.deleteSource(sourceIdRequestBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
import io.airbyte.server.handlers.SourceDefinitionsHandler;
import io.micronaut.context.annotation.Context;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand All @@ -50,6 +52,7 @@ public SourceDefinitionRead createCustomSourceDefinition(final CustomSourceDefin
@Post("/delete")
@Secured({ADMIN})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteSourceDefinition(final SourceDefinitionIdRequestBody sourceDefinitionIdRequestBody) {
ApiHelper.execute(() -> {
sourceDefinitionsHandler.deleteSourceDefinition(sourceDefinitionIdRequestBody);
Expand Down Expand Up @@ -109,6 +112,7 @@ public SourceDefinitionReadList listSourceDefinitionsForWorkspace(final Workspac
@Post("/revoke_definition")
@Secured({ADMIN})
@Override
@Status(HttpStatus.NO_CONTENT)
public void revokeSourceDefinitionFromWorkspace(final SourceDefinitionIdWithWorkspaceId sourceDefinitionIdWithWorkspaceId) {
ApiHelper.execute(() -> {
sourceDefinitionsHandler.revokeSourceDefinitionFromWorkspace(sourceDefinitionIdWithWorkspaceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import io.airbyte.api.model.generated.WorkspaceUpdateName;
import io.airbyte.server.handlers.WorkspacesHandler;
import io.micronaut.context.annotation.Requires;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Status;
import io.micronaut.security.annotation.Secured;
import io.micronaut.security.rules.SecurityRule;

Expand All @@ -48,6 +50,7 @@ public WorkspaceRead createWorkspace(@Body final WorkspaceCreate workspaceCreate
@Post("/delete")
@Secured({OWNER})
@Override
@Status(HttpStatus.NO_CONTENT)
public void deleteWorkspace(@Body final WorkspaceIdRequestBody workspaceIdRequestBody) {
ApiHelper.execute(() -> {
workspacesHandler.deleteWorkspace(workspaceIdRequestBody);
Expand Down