You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by "JHoelli (via GitHub)" <gi...@apache.org> on 2025/11/18 08:57:38 UTC
[PR] Function for testing the export provider setting
JHoelli opened a new pull request, #3942:
URL: https://github.com/apache/streampipes/pull/3942
### Purpose
New function for testing the connectivity to export providers.
<img width="896" height="266" alt="image" src="https://github.com/user-attachments/assets/872011d3-eaee-4a71-b837-eba23f36804d" />
<img width="883" height="349" alt="image" src="https://github.com/user-attachments/assets/a3aba586-67f2-4581-9885-57d45a3ba394" />
<img width="887" height="645" alt="image" src="https://github.com/user-attachments/assets/d5ecf452-1c29-4b39-83f7-c59b54743590" />
<img width="883" height="191" alt="image" src="https://github.com/user-attachments/assets/0d385bc3-34c3-4527-9527-f439d5cce65c" />
### Remarks
1. Java Endpoint for Testing
2. Frontend for testing the connection and showing the error
PR introduces (a) breaking change(s): no
PR introduces (a) deprecation(s): no
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add connection test to export provider
Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe merged PR #3942:
URL: https://github.com/apache/streampipes/pull/3942
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add connection test to export provider
Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe commented on code in PR #3942:
URL: https://github.com/apache/streampipes/pull/3942#discussion_r2546268648
##########
streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/ExportProviderConfigurationResource.java:
##########
@@ -48,14 +59,72 @@ public ResponseEntity<List<ExportProviderSettings>> getExportProviderConfigurati
}
@GetMapping(value = "/{providerId}", produces = MediaType.APPLICATION_JSON_VALUE)
-@PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
-public ResponseEntity<ExportProviderSettings> getExportProviderSettingById(@PathVariable String providerId) {
+ @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
+ public ResponseEntity<ExportProviderSettings> getExportProviderSettingById(@PathVariable String providerId) {
return getSpCoreConfigurationStorage().get().getExportProviderSettings().stream()
.filter(setting -> setting.getProviderId().equalsIgnoreCase(providerId))
.findFirst()
.map(ResponseEntity::ok)
.orElse(ResponseEntity.notFound().build());
-}
+ }
+
+ @GetMapping(value = "/test/{providerId}", produces = MediaType.APPLICATION_JSON_VALUE)
+ @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
+ public ResponseEntity<?> testExportProviderSettingById(@PathVariable String providerId) {
+ // Get Export Provider Settings
+ Optional<ExportProviderSettings> exportProviderSetting = getSpCoreConfigurationStorage().get()
Review Comment:
Can you move this class into a service class?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add connection test to export provider
Posted by "dominikriemer (via GitHub)" <gi...@apache.org>.
dominikriemer commented on code in PR #3942:
URL: https://github.com/apache/streampipes/pull/3942#discussion_r2538653335
##########
streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/ExportProviderConfigurationResource.java:
##########
@@ -48,14 +59,72 @@ public ResponseEntity<List<ExportProviderSettings>> getExportProviderConfigurati
}
@GetMapping(value = "/{providerId}", produces = MediaType.APPLICATION_JSON_VALUE)
-@PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
-public ResponseEntity<ExportProviderSettings> getExportProviderSettingById(@PathVariable String providerId) {
+ @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
+ public ResponseEntity<ExportProviderSettings> getExportProviderSettingById(@PathVariable String providerId) {
return getSpCoreConfigurationStorage().get().getExportProviderSettings().stream()
.filter(setting -> setting.getProviderId().equalsIgnoreCase(providerId))
.findFirst()
.map(ResponseEntity::ok)
.orElse(ResponseEntity.notFound().build());
-}
+ }
+
+ @GetMapping(value = "/test/{providerId}", produces = MediaType.APPLICATION_JSON_VALUE)
+ @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
+ public ResponseEntity<?> testExportProviderSettingById(@PathVariable String providerId) {
+ // Get Export Provider Settings
+ Optional<ExportProviderSettings> exportProviderSetting = getSpCoreConfigurationStorage().get()
+ .getExportProviderSettings().stream()
+ .filter(setting -> setting.getProviderId().equalsIgnoreCase(providerId))
+ .findFirst();
+
+ if (exportProviderSetting.isPresent()) {
+ ExportProviderSettings setting = exportProviderSetting.get();
+ ProviderType providerType = setting.getProviderType();
+
+ try {
+
+ IObjectStorage exportProvider = ExportProviderFactory.createExportProvider(
+ providerType, "TEST", setting,
+ "csv");
+
+ String filePath = exportProvider.getFileName();
+
+ String csvData = "Message\nThis Testfile was automatically creates as a connectivity test by Streampipes.\n";
Review Comment:
```suggestion
String csvData = "Message\nThis test file was automatically created as a connectivity test by StreamPipes.\n";
```
##########
ui/deployment/i18n/de.json:
##########
@@ -901,8 +891,8 @@
"No assets found - use assets to better organize resources!": "Keine Assets gefunden - verwenden Sie Assets, um Ressourcen besser zu organisieren!",
"Manage assets": "Assets verwalten",
"Asset Browser": "Asset-Browser",
- "Browse assets": "Assets durchsuchen",
"Filter assets": "Assets filtern",
+ "All assets": "Alle Vermögenswerte",
Review Comment:
```suggestion
"All assets": "Alle Assets",
```
##########
ui/src/app/configuration/dialog/export-provider-connection-test/export-provider-connection-test.component.ts:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { Component, inject, Input, OnInit } from '@angular/core';
+import { DialogRef } from '@streampipes/shared-ui';
+import { ExportProviderService } from '@streampipes/platform-services';
+import { TranslateService } from '@ngx-translate/core';
+
+@Component({
+ selector: 'sp-export-provider-connection-test',
+ templateUrl: './export-provider-connection-test.component.html',
+ standalone: false,
+})
+export class ExportProviderConnectionTestComponent implements OnInit {
+ ngOnInit(): void {
+ this.testExportProvider();
+ }
+ @Input()
+ providerId: string;
+
+ private dialogRef = inject(
+ DialogRef<ExportProviderConnectionTestComponent>,
+ );
+ private exportProviderRestService = inject(ExportProviderService);
+ private translateService = inject(TranslateService);
+
+ isInProgress = false;
+ currentStatus: any;
+ errorMessage = '';
+ isError = false;
+ message = '';
+ filePath = '';
+
+ close(refreshDataLakeIndex: boolean) {
+ this.dialogRef.close(refreshDataLakeIndex);
+ }
+
+ testExportProvider() {
+ this.isInProgress = true;
+ this.currentStatus = this.translateService.instant(
+ 'Testing the connection.',
+ );
+ this.exportProviderRestService
+ .testExportProviderById(this.providerId)
+ .subscribe(
+ data => {
+ this.isInProgress = false;
Review Comment:
probably makes sense to set `isError` to false in case of multiple attempts
##########
ui/src/app/configuration/datalake-configuration/datalake-configuration.component.ts:
##########
@@ -237,6 +239,25 @@ export class DatalakeConfigurationComponent implements OnInit {
}
});
}
+ testExportProvider(providerId: string) {
+ const dialogRef: DialogRef<ExportProviderConnectionTestComponent> =
+ this.dialogService.open(ExportProviderConnectionTestComponent, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: this.translateService.instant(
+ ' Test Export Provider Connection',
Review Comment:
```suggestion
'Test Export Provider Connection',
```
##########
ui/src/app/configuration/datalake-configuration/datalake-configuration.component.ts:
##########
@@ -237,6 +239,25 @@ export class DatalakeConfigurationComponent implements OnInit {
}
});
}
+ testExportProvider(providerId: string) {
+ const dialogRef: DialogRef<ExportProviderConnectionTestComponent> =
+ this.dialogService.open(ExportProviderConnectionTestComponent, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: this.translateService.instant(
+ ' Test Export Provider Connection',
Review Comment:
this should also be changed in the translation files
##########
ui/src/app/configuration/dialog/export-provider-connection-test/export-provider-connection-test.component.ts:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { Component, inject, Input, OnInit } from '@angular/core';
+import { DialogRef } from '@streampipes/shared-ui';
+import { ExportProviderService } from '@streampipes/platform-services';
+import { TranslateService } from '@ngx-translate/core';
+
+@Component({
+ selector: 'sp-export-provider-connection-test',
+ templateUrl: './export-provider-connection-test.component.html',
+ standalone: false,
+})
+export class ExportProviderConnectionTestComponent implements OnInit {
+ ngOnInit(): void {
+ this.testExportProvider();
+ }
+ @Input()
+ providerId: string;
+
+ private dialogRef = inject(
+ DialogRef<ExportProviderConnectionTestComponent>,
+ );
+ private exportProviderRestService = inject(ExportProviderService);
+ private translateService = inject(TranslateService);
+
+ isInProgress = false;
+ currentStatus: any;
Review Comment:
Can `currentStatus` be a `string`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org