diff --git a/libs/service-client/src/Service.php b/libs/service-client/src/Service.php index abeb01ce3..363dd9d7f 100644 --- a/libs/service-client/src/Service.php +++ b/libs/service-client/src/Service.php @@ -20,13 +20,11 @@ enum Service case QUERY; case QUEUE; case QUEUE_INTERNAL_API; - case SANDBOXES_API; case SANDBOXES_SERVICE; case SCHEDULER; case SYNC_ACTIONS; case TEMPLATES; case VAULT; - case WAII; public function getPublicSubdomain(): string { @@ -43,13 +41,11 @@ public function getPublicSubdomain(): string self::QUERY => 'query', self::QUEUE => 'queue', self::QUEUE_INTERNAL_API => throw new RuntimeException('Job queue internal API does not have public DNS'), - self::SANDBOXES_API => 'sandboxes', self::SANDBOXES_SERVICE => 'data-science', self::SCHEDULER => 'scheduler', self::SYNC_ACTIONS => 'sync-actions', self::TEMPLATES => 'templates', self::VAULT => 'vault', - self::WAII => 'waii', }; } @@ -68,13 +64,11 @@ public function getInternalServiceName(): string self::QUERY => 'query-service-api.query-service', self::QUEUE => 'job-queue-api.default', self::QUEUE_INTERNAL_API => 'job-queue-internal-api.default', - self::SANDBOXES_API => 'sandboxes-api.sandboxes', self::SANDBOXES_SERVICE => 'sandboxes-service-api.default', self::SCHEDULER => 'scheduler-api.default', self::SYNC_ACTIONS => 'runner-sync-api.default', self::TEMPLATES => 'templates-api.templates-api', self::VAULT => 'vault-api.default', - self::WAII => 'waii-svc.waii', }; } } diff --git a/libs/service-client/src/ServiceClient.php b/libs/service-client/src/ServiceClient.php index e57b7536d..ee223280b 100644 --- a/libs/service-client/src/ServiceClient.php +++ b/libs/service-client/src/ServiceClient.php @@ -116,14 +116,6 @@ public function getNotificationServiceUrl(?ServiceDnsType $dnsType = null): stri return $this->getServiceUrl(Service::NOTIFICATION, $dnsType); } - /** - * @return non-empty-string - */ - public function getSandboxesApiUrl(?ServiceDnsType $dnsType = null): string - { - return $this->getServiceUrl(Service::SANDBOXES_API, $dnsType); - } - /** * @return non-empty-string */ @@ -179,12 +171,4 @@ public function getVaultUrl(?ServiceDnsType $dnsType = null): string { return $this->getServiceUrl(Service::VAULT, $dnsType); } - - /** - * @return non-empty-string - */ - public function getWaiiServiceUrl(?ServiceDnsType $dnsType = null): string - { - return $this->getServiceUrl(Service::WAII, $dnsType); - } } diff --git a/libs/service-client/tests/ServiceClientTest.php b/libs/service-client/tests/ServiceClientTest.php index e4e8fd670..101d8d3a8 100644 --- a/libs/service-client/tests/ServiceClientTest.php +++ b/libs/service-client/tests/ServiceClientTest.php @@ -22,12 +22,10 @@ class ServiceClientTest extends TestCase private const PUBLIC_NOTIFICATION_SERVICE = 'https://notification.north-europe.azure.keboola.com'; private const PUBLIC_OAUTH = 'https://oauth.north-europe.azure.keboola.com'; private const PUBLIC_QUEUE = 'https://queue.north-europe.azure.keboola.com'; - private const PUBLIC_SANDBOXES_SERVICE = 'https://sandboxes.north-europe.azure.keboola.com'; private const PUBLIC_SCHEDULER_SERVICE = 'https://scheduler.north-europe.azure.keboola.com'; private const PUBLIC_SYNC_ACTIONS_SERVICE = 'https://sync-actions.north-europe.azure.keboola.com'; private const PUBLIC_TEMPLATES = 'https://templates.north-europe.azure.keboola.com'; private const PUBLIC_VAULT = 'https://vault.north-europe.azure.keboola.com'; - private const PUBLIC_WAII_SERVICE = 'https://waii.north-europe.azure.keboola.com'; private const PUBLIC_QUERY_SERVICE = 'https://query.north-europe.azure.keboola.com'; private const INTERNAL_AI_SERVICE = 'http://ai-service-api.default.svc.cluster.local'; @@ -43,12 +41,10 @@ class ServiceClientTest extends TestCase private const INTERNAL_QUERY_SERVICE = 'http://query-service-api.query-service.svc.cluster.local'; private const INTERNAL_QUEUE = 'http://job-queue-api.default.svc.cluster.local'; private const INTERNAL_QUEUE_INTERNAL_API = 'http://job-queue-internal-api.default.svc.cluster.local'; - private const INTERNAL_SANDBOXES_SERVICE = 'http://sandboxes-api.sandboxes.svc.cluster.local'; private const INTERNAL_SCHEDULER_SERVICE = 'http://scheduler-api.default.svc.cluster.local'; private const INTERNAL_SYNC_ACTIONS_SERVICE = 'http://runner-sync-api.default.svc.cluster.local'; private const INTERNAL_TEMPLATES = 'http://templates-api.templates-api.svc.cluster.local'; private const INTERNAL_VAULT = 'http://vault-api.default.svc.cluster.local'; - private const INTERNAL_WAII_SERVICE = 'http://waii-svc.waii.svc.cluster.local'; public function testGetExplicitPublicUrlMethods(): void { @@ -67,12 +63,10 @@ public function testGetExplicitPublicUrlMethods(): void self::assertSame(self::PUBLIC_OAUTH, $client->getOauthUrl(ServiceDnsType::PUBLIC)); self::assertSame(self::PUBLIC_QUERY_SERVICE, $client->getQueryServiceUrl(ServiceDnsType::PUBLIC)); self::assertSame(self::PUBLIC_QUEUE, $client->getQueueUrl(ServiceDnsType::PUBLIC)); - self::assertSame(self::PUBLIC_SANDBOXES_SERVICE, $client->getSandboxesApiUrl(ServiceDnsType::PUBLIC)); self::assertSame(self::PUBLIC_SCHEDULER_SERVICE, $client->getSchedulerServiceUrl(ServiceDnsType::PUBLIC)); self::assertSame(self::PUBLIC_SYNC_ACTIONS_SERVICE, $client->getSyncActionsServiceUrl(ServiceDnsType::PUBLIC)); self::assertSame(self::PUBLIC_TEMPLATES, $client->getTemplatesUrl(ServiceDnsType::PUBLIC)); self::assertSame(self::PUBLIC_VAULT, $client->getVaultUrl(ServiceDnsType::PUBLIC)); - self::assertSame(self::PUBLIC_WAII_SERVICE, $client->getWaiiServiceUrl(ServiceDnsType::PUBLIC)); } public function testGetDefaultPublicUrlMethods(): void @@ -91,12 +85,10 @@ public function testGetDefaultPublicUrlMethods(): void self::assertSame(self::PUBLIC_OAUTH, $client->getOauthUrl()); self::assertSame(self::PUBLIC_QUERY_SERVICE, $client->getQueryServiceUrl()); self::assertSame(self::PUBLIC_QUEUE, $client->getQueueUrl()); - self::assertSame(self::PUBLIC_SANDBOXES_SERVICE, $client->getSandboxesApiUrl()); self::assertSame(self::PUBLIC_SCHEDULER_SERVICE, $client->getSchedulerServiceUrl()); self::assertSame(self::PUBLIC_SYNC_ACTIONS_SERVICE, $client->getSyncActionsServiceUrl()); self::assertSame(self::PUBLIC_TEMPLATES, $client->getTemplatesUrl()); self::assertSame(self::PUBLIC_VAULT, $client->getVaultUrl()); - self::assertSame(self::PUBLIC_WAII_SERVICE, $client->getWaiiServiceUrl()); } public function testGetExplicitPublicUrlOfServiceWithoutPublicDns(): void @@ -139,12 +131,10 @@ public function testGetExplicitInternalUrlMethods(): void self::assertSame(self::INTERNAL_QUERY_SERVICE, $client->getQueryServiceUrl(ServiceDnsType::INTERNAL)); self::assertSame(self::INTERNAL_QUEUE, $client->getQueueUrl(ServiceDnsType::INTERNAL)); self::assertSame(self::INTERNAL_QUEUE_INTERNAL_API, $client->getQueueInternalApiUrl(ServiceDnsType::INTERNAL)); - self::assertSame(self::INTERNAL_SANDBOXES_SERVICE, $client->getSandboxesApiUrl(ServiceDnsType::INTERNAL)); self::assertSame(self::INTERNAL_SCHEDULER_SERVICE, $client->getSchedulerServiceUrl(ServiceDnsType::INTERNAL)); self::assertSame(self::INTERNAL_SYNC_ACTIONS_SERVICE, $client->getSyncActionsServiceUrl(ServiceDnsType::INTERNAL)); self::assertSame(self::INTERNAL_TEMPLATES, $client->getTemplatesUrl(ServiceDnsType::INTERNAL)); self::assertSame(self::INTERNAL_VAULT, $client->getVaultUrl(ServiceDnsType::INTERNAL)); - self::assertSame(self::INTERNAL_WAII_SERVICE, $client->getWaiiServiceUrl(ServiceDnsType::INTERNAL)); // phpcs:enable Generic.Files.LineLength } @@ -165,11 +155,9 @@ public function testGetDefaultInternalUrlMethods(): void self::assertSame(self::INTERNAL_QUERY_SERVICE, $client->getQueryServiceUrl()); self::assertSame(self::INTERNAL_QUEUE, $client->getQueueUrl()); self::assertSame(self::INTERNAL_QUEUE_INTERNAL_API, $client->getQueueInternalApiUrl()); - self::assertSame(self::INTERNAL_SANDBOXES_SERVICE, $client->getSandboxesApiUrl()); self::assertSame(self::INTERNAL_SCHEDULER_SERVICE, $client->getSchedulerServiceUrl()); self::assertSame(self::INTERNAL_SYNC_ACTIONS_SERVICE, $client->getSyncActionsServiceUrl()); self::assertSame(self::INTERNAL_TEMPLATES, $client->getTemplatesUrl()); self::assertSame(self::INTERNAL_VAULT, $client->getVaultUrl()); - self::assertSame(self::INTERNAL_WAII_SERVICE, $client->getWaiiServiceUrl()); } } diff --git a/libs/service-client/tests/ServiceTest.php b/libs/service-client/tests/ServiceTest.php index 870271dcd..4420eec5c 100644 --- a/libs/service-client/tests/ServiceTest.php +++ b/libs/service-client/tests/ServiceTest.php @@ -24,10 +24,8 @@ public static function providePublicSubdomains(): iterable yield 'notification' => [Service::NOTIFICATION, 'notification']; yield 'oauth' => [Service::OAUTH, 'oauth']; yield 'queue' => [Service::QUEUE, 'queue']; - yield 'sandboxes' => [Service::SANDBOXES_API, 'sandboxes']; yield 'scheduler' => [Service::SCHEDULER, 'scheduler']; yield 'sync-actions' => [Service::SYNC_ACTIONS, 'sync-actions']; - yield 'waii' => [Service::WAII, 'waii']; } #[DataProvider('providePublicSubdomains')] @@ -66,10 +64,8 @@ public static function provideInternalServiceNames(): iterable yield 'oauth' => [Service::OAUTH, 'oauth-api.default']; yield 'queue' => [Service::QUEUE, 'job-queue-api.default']; yield 'queue internal api' => [Service::QUEUE_INTERNAL_API, 'job-queue-internal-api.default']; - yield 'sandboxes' => [Service::SANDBOXES_API, 'sandboxes-api.sandboxes']; // <-- custom namespace yield 'scheduler' => [Service::SCHEDULER, 'scheduler-api.default']; yield 'sync-actions' => [Service::SYNC_ACTIONS, 'runner-sync-api.default']; - yield 'waii' => [Service::WAII, 'waii-svc.waii']; } #[DataProvider('provideInternalServiceNames')]