Class ClientUtil
java.lang.Object
com.google.jenkins.plugins.computeengine.client.ClientUtil
Utilities for using the gcp-plugin-core clients.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ComputeClientV2createComputeClientV2(String projectId, String credentialsId) static com.google.cloud.graphite.platforms.plugin.client.ClientFactorygetClientFactory(ItemGroup itemGroup, com.google.common.collect.ImmutableList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements, String credentialsId, Optional<com.google.api.client.http.HttpTransport> transport) Creates aClientFactoryfor generating the GCP API clients.static com.google.cloud.graphite.platforms.plugin.client.ClientFactorygetClientFactory(ItemGroup itemGroup, String credentialsId) Creates aClientFactoryfor generating the GCP API clients.
-
Constructor Details
-
ClientUtil
public ClientUtil()
-
-
Method Details
-
getClientFactory
public static com.google.cloud.graphite.platforms.plugin.client.ClientFactory getClientFactory(ItemGroup itemGroup, com.google.common.collect.ImmutableList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements, String credentialsId, Optional<com.google.api.client.http.HttpTransport> transport) throws AbortException Creates aClientFactoryfor generating the GCP API clients.- Parameters:
itemGroup- The Jenkins context to use for retrieving the credentials.domainRequirements- A list of domain requirements.credentialsId- The ID of the credentials to use for generating clients.transport- AnOptionalparameter that specifies theHttpTransportto use. A default will be used if unspecified.- Returns:
- A
ClientFactoryto get clients. - Throws:
AbortException- If there was an error initializing the ClientFactory.
-
getClientFactory
public static com.google.cloud.graphite.platforms.plugin.client.ClientFactory getClientFactory(ItemGroup itemGroup, String credentialsId) throws AbortException Creates aClientFactoryfor generating the GCP API clients.- Parameters:
itemGroup- The Jenkins context to use for retrieving the credentials.credentialsId- The ID of the credentials to use for generating clients.- Returns:
- A
ClientFactoryto get clients. - Throws:
AbortException- If there was an error initializing the ClientFactory.
-
createComputeClientV2
public static ComputeClientV2 createComputeClientV2(String projectId, String credentialsId) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-