Search in sources :

Example 1 with HttpBearerAuth

use of com.openshift.cloud.api.connector.invoker.auth.HttpBearerAuth in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ManagedConnectorServiceApplication method pollSlackConnector.

private Connector pollSlackConnector(Connector connector) throws InterruptedException, ApiException {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath(baseUrl);
    HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer");
    Bearer.setBearerToken(bearerToken);
    ConnectorsApi connectorsAPI = createConnectorsAPI();
    Connector fetchedConnector = connectorsAPI.getConnector(connector.getId(), "");
    System.out.println(fetchedConnector.getStatus());
    Thread.sleep(5000);
    return fetchedConnector;
}
Also used : SlackConnector(com.redhat.service.dto.request.SlackConnector) Connector(com.openshift.cloud.api.connector.models.Connector) HttpBearerAuth(com.openshift.cloud.api.connector.invoker.auth.HttpBearerAuth) ConnectorsApi(com.openshift.cloud.api.connector.ConnectorsApi) ApiClient(com.openshift.cloud.api.connector.invoker.ApiClient)

Example 2 with HttpBearerAuth

use of com.openshift.cloud.api.connector.invoker.auth.HttpBearerAuth in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ManagedConnectorServiceApplication method createConnectorsAPI.

private ConnectorsApi createConnectorsAPI() {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath(baseUrl);
    HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer");
    Bearer.setBearerToken(bearerToken);
    return new ConnectorsApi(defaultClient);
}
Also used : HttpBearerAuth(com.openshift.cloud.api.connector.invoker.auth.HttpBearerAuth) ConnectorsApi(com.openshift.cloud.api.connector.ConnectorsApi) ApiClient(com.openshift.cloud.api.connector.invoker.ApiClient)

Aggregations

ConnectorsApi (com.openshift.cloud.api.connector.ConnectorsApi)2 ApiClient (com.openshift.cloud.api.connector.invoker.ApiClient)2 HttpBearerAuth (com.openshift.cloud.api.connector.invoker.auth.HttpBearerAuth)2 Connector (com.openshift.cloud.api.connector.models.Connector)1 SlackConnector (com.redhat.service.dto.request.SlackConnector)1