Package jetbrains.buildServer.clouds
Interface CloudClient
-
- All Superinterfaces:
CloudErrorProvider
- All Known Subinterfaces:
CloudClientEx
- All Known Implementing Classes:
BrokenClient
,CloudClientCanStartProxy
,DisposingCloudClientProxy
,DummyCloudClient
,ReadonlyClient
public interface CloudClient extends CloudErrorProvider
Represents a cloud accessing facade, excepting authentication connect maintenance. Each operation should be thread safe.- Since:
- 5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default boolean
canStartNewInstance(CloudImage image)
Deprecated.since 2018.1default CanStartNewInstanceResult
canStartNewInstanceWithDetails(CloudImage image)
Call this method to check if it is possible (in theory) to start new instance of a given image in this profile.CloudImage
findImageById(String imageId)
Looks for an image with the specified identifier and returns its handle.CloudInstance
findInstanceByAgent(AgentDescription agent)
Checks if the agent is an instnce of one of the running instances of that cloud profile.String
generateAgentName(AgentDescription agent)
Generated name for build agent that is thought to be running as instance of this cloud client.default CloudErrorInfo
getErrorInfo()
Returns currect error info if there was any or null.Collection<? extends CloudImage>
getImages()
Lists all user selected images.default Integer
getInstancesLimit()
The maximum number of instances associated to the profile.default boolean
isInitialized()
Checks if the client data is fully ready to be queried by the system.
-
-
-
Method Detail
-
isInitialized
default boolean isInitialized()
Checks if the client data is fully ready to be queried by the system. Actually, it may take some time to communicate to the cloud service. All interface members may not return full information if false was returned from this method.- Returns:
- true if the cloud is fully initialized.
-
findImageById
@Nullable CloudImage findImageById(@NotNull String imageId) throws CloudException
Looks for an image with the specified identifier and returns its handle.- Parameters:
imageId
- idetifier of the image to look for. SeeCloudImage.getId()
.- Returns:
- image handle.
- Throws:
CloudException
- on error
-
findInstanceByAgent
@Nullable CloudInstance findInstanceByAgent(@NotNull AgentDescription agent)
Checks if the agent is an instnce of one of the running instances of that cloud profile.- Parameters:
agent
- agent description of an agent that is going to connect- Returns:
- corresponding
CloudInstance
if found or null
-
getImages
@NotNull Collection<? extends CloudImage> getImages() throws CloudException
Lists all user selected images. The method should either return an unmodifiable snapshot of the images or a thread-safe collection.- Returns:
- list of all available images; their order is undefined.
- Throws:
CloudException
- on error
-
getErrorInfo
@Nullable default CloudErrorInfo getErrorInfo()
Returns currect error info if there was any or null. Can be null. Returning error info marks this profile as error-containing and not relayable.- Specified by:
getErrorInfo
in interfaceCloudErrorProvider
- Returns:
- error info or null
-
canStartNewInstance
@Deprecated default boolean canStartNewInstance(@NotNull CloudImage image)
Deprecated.since 2018.1Call this method to check if it is possible (in theory) to start new instance of a given image in this profile. Deprecated since 2018.1. jetbrains.buildServer.clouds.CloudClient#canStartNewInstanceWithDetails(jetbrains.buildServer.clouds.CloudImage) is being used instead.- Parameters:
image
- image to start new instance from- Returns:
- can start new instance or not
-
canStartNewInstanceWithDetails
@NotNull default CanStartNewInstanceResult canStartNewInstanceWithDetails(@NotNull CloudImage image)
Call this method to check if it is possible (in theory) to start new instance of a given image in this profile.- Parameters:
image
- image to start new instance from- Returns:
- can start new instance result with details
- Since:
- 2018.1
-
generateAgentName
@Nullable String generateAgentName(@NotNull AgentDescription agent)
Generated name for build agent that is thought to be running as instance of this cloud client.- Parameters:
agent
- agent instance- Returns:
- proposed build agent name or null
- Since:
- 6.0
-
getInstancesLimit
@Nullable default Integer getInstancesLimit()
The maximum number of instances associated to the profile. A positive number will represent the true limit of instances. Null will represent if the information is not available, undefined, or an unlimited number of instances is allowed.- Returns:
- see above
- Since:
- 2022.12
-
-