Accessing Topology service Swagger UI
You can access the Topology service Swagger using port forwarding.
Before you begin
You need to be an administrator with oc client
access in order to get secrets, services, and to
enable port-forwarding in the ASM namespace.
About this task
A simple way to access the Topology service Swagger is to use
the oc port-forward command. You can then access
Swagger on your local browser through localhost.
Port forwarding will be enabled temporarily
only. When there is no traffic, it will automatically be
closed.
- To log on, use
oc login - To obtain the service name, use
oc get service - To enable port forwarding, use
oc port-forward service/aiops-topology-topology 8080
Enable port forwarding
See the following steps as an example.
-
Log on using the
oc logincommand. -
Find the secret storing the credentials for Swagger using the
oc get secret | grep topology-asm-credentialscommand.System output:
aiops-topology-asm-credentials Opaque 2 3h54m -
Find the topology service secret using the
oc get service | grep topology-topologycommand.System output:
aiops-topology-topology ClusterIP 1.2.3.4 <none> 8080/TCP,8081/TCP 3h49m -
Enable port forwarding using the
oc port-forward service/aiops-topology-topology 8080command.System output:
Forwarding from 127.0.0.1:8080 -> 8080 Forwarding from [::1]:8080 -> 8080Note: If the port is not accessed for a while, the connection is closed:Forwarding from [::1]:8080 -> 8080 E0622 07:57:52.101053 25681 portforward.go:233] lost connection to pod -
Now access the topology service swagger api in a browser on the same host as the one the oc commands were run on, at the following URL
https://localhost:8080/1.0/topology/swagger -
Authorise using the credentials from the secret obtained in step 3.