Interface CloudManager

    • Method Detail

      • isIntegrationEnabled

        boolean isIntegrationEnabled​(String projectId)
        Parameters:
        projectId -
        Returns:
        false if user decided to disabled cloud integration at all
      • isConfigurable

        boolean isConfigurable​(@NotNull
                               String projectId)
        Returns true if user can enable/disable configuration in the current project's tree
        Parameters:
        projectId - project internal id
        Returns:
        see above
      • updateStatus

        void updateStatus​(String projectId,
                          @NotNull
                          ProjectCloudIntegrationStatus newStatus)
        Updates enabled/disabled status of integration
        Parameters:
        isDisabled - true to make integration enabled
        projectId -
        newStatus -
      • getProjectIntegrationStatus

        @Nullable
        ProjectCloudIntegrationStatus getProjectIntegrationStatus​(String projectId)
        Parameters:
        projectId - - project internal id
        Returns:
        returns cloud integration status information in this project; null, if project doesn't have any information (inherits from parent project)
      • listProfilesByProject

        @NotNull
        Collection<CloudProfile> listProfilesByProject​(String projectId,
                                                       boolean includeFromSubprojects)
        Returns cloud profiles defined in the current project.
        Parameters:
        projectId -
        includeFromSubprojects -
        Returns:
        list of profiles; order of items is not specified (or depend on this interface implementation); empty list when no ones.
      • listAllProfiles

        @NotNull
        Collection<CloudProfile> listAllProfiles()
        Returns all cloud profiles.
        Parameters:
        projectId -
        Returns:
        list of profiles; order of items is not specified (or depend on this interface implementation); empty list when no ones.
      • getCloudTypes

        @NotNull
        Collection<? extends CloudType> getCloudTypes()
        Returns all available "Real" cloud types, excluding ReadOnlyClient (which is not a "real" cloud type, but rather used to show instances on the secondary nodes).
        Returns:
        list of types. No order specified
      • findCloudType

        @Nullable
        CloudType findCloudType​(@Nullable
                                String cloudName)
        Returns cloud type for name or null
        Parameters:
        cloudName - cloud type ID
        Returns:
        registered cloud type or null
      • findProfileById

        @Nullable
        CloudProfile findProfileById​(@NotNull
                                     String projectId,
                                     @NotNull
                                     String profileId)
        Returns profile by the specified identifier in a certain project.
        Parameters:
        profileId - , see CloudProfile.getProfileId().
        projectId - internal project id
        Returns:
        found profile or null if no such ones.
      • findProfileGloballyById

        @Nullable
        CloudProfile findProfileGloballyById​(@NotNull
                                             String profileId)
        Returns profile by the specified identifier.
        Parameters:
        profileId - , see CloudProfile.getProfileId().
        projectId -
        Returns:
        found profile or null if no such ones.
      • findInstanceById

        @Nullable
        CloudInstance findInstanceById​(@NotNull
                                       String projectId,
                                       @NotNull
                                       String profileId,
                                       @NotNull
                                       String instanceId)
        Returns instance by the specified identifier.
        Parameters:
        profileId -
        Returns:
        found instance or null if no such ones.
      • findInstanceByAgent

        @Nullable
        Pair<CloudProfile,​CloudInstance> findInstanceByAgent​(@NotNull
                                                                   AgentDescription agent)
        Checks if the agent is an instnce of one of the running instances.
        Parameters:
        agent - agent description of an agent that is going to connect
        Returns:
        corresponding CloudInstance if found or null
      • findInstancesByAgents

        @NotNull
        Map<AgentDescription,​Pair<CloudProfile,​CloudInstance>> findInstancesByAgents​(@NotNull
                                                                                                 Collection<? extends AgentDescription> agents)
        Finds cloud instances (if any) for the collection of agents
        Parameters:
        agents - agent descriptions of agents
        Returns:
        found pairs of agents and cloud instances. For agents that we don't find cloud instance for there's no entry in this collection
      • getDescriptionFor

        @Nullable
        SAgentType getDescriptionFor​(@NotNull
                                     CloudProfile profile,
                                     @NotNull
                                     String imageId)
        Fetches recorded agent description
        Parameters:
        profile - profile
        imageId - image id
        Returns:
        description if found
      • findAgentByInstance

        @NotNull
        Collection<SBuildAgent> findAgentByInstance​(@NotNull
                                                    String profileId,
                                                    @NotNull
                                                    String instanceId)
        Parameters:
        profile - profile
        instance - instance
        Returns:
        agent, if any, that associated with the instance, profile pair
        Since:
        2020.2
      • isImageWithAgent

        boolean isImageWithAgent​(@NotNull
                                 CloudProfile profile,
                                 @NotNull
                                 CloudImage image)
        Checks if the image is configured to start agent. If unknown - true is returned
        Parameters:
        profile - profile
        image - image
        Returns:
        true is this image may contain agent, false if it is definitly broken
      • getServerUrlForAgent

        @NotNull
        String getServerUrlForAgent​(@NotNull
                                    CloudProfile profile,
                                    @NotNull
                                    CloudImage image)
        Server url that will be sent to new created build agent
        Parameters:
        profile - profile
        image - image
        Returns:
        server url
      • 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
      • isInstanceExpired

        @Deprecated
        default boolean isInstanceExpired​(@NotNull
                                          CloudProfile profile,
                                          @NotNull
                                          CloudInstance instance)
        Deprecated.
        Returns true, if instance will be terminated after current build finishes
        Parameters:
        instance -
        Returns:
        true, if no other buids will be run on this instance. False otherwise
        Since:
        10.0
      • isInstanceExpired

        boolean isInstanceExpired​(@NotNull
                                  String profileId,
                                  @NotNull
                                  String instanceId)
        Returns true, if instance will be terminated after current build finishes
        Parameters:
        profileId -
        instanceId -
        Returns:
        true, if no other buids will be run on this instance. False otherwise
        Since:
        2020.2
      • markInstanceExpired

        @Deprecated
        default void markInstanceExpired​(@NotNull
                                         CloudProfile profile,
                                         @NotNull
                                         CloudInstance instance)
        Deprecated.
        Marks the instance as expired, so it should be terminated after current build finishes
        Parameters:
        profile -
        instance -
        Since:
        10.0
      • markInstanceExpired

        void markInstanceExpired​(@NotNull
                                 String profileId,
                                 @NotNull
                                 String instanceId)
        Marks the instance as expired, so it should be terminated after current build finishes
        Parameters:
        profileId -
        instanceId -
        Since:
        2020.2
      • removeProfile

        boolean removeProfile​(@NotNull
                              String projectId,
                              @NotNull
                              String profileId)
      • removeProfileAndInstances

        default void removeProfileAndInstances​(@NotNull
                                               String projectId,
                                               @NotNull
                                               String profileId,
                                               TerminateInstanceReason reason)
        Terminate all running instance for the profile and then removes the profile itself
        Parameters:
        projectId - projectId
        profileId - profileId
        reason - reason of temination
      • setProfileEnabled

        void setProfileEnabled​(@NotNull
                               String projectId,
                               @NotNull
                               String profileId,
                               boolean enabled)
      • deleteImageAndInstances

        void deleteImageAndInstances​(@NotNull
                                     String projectId,
                                     @NotNull
                                     String profileId,
                                     @NotNull
                                     String imageId,
                                     @NotNull
                                     TerminateInstanceReason reason)
        Deletes a cloud image with the specified imageId from a cloud profile. Will also remove any instances running of this image
        Parameters:
        projectId - The ID of the project that the image belongs to. Cannot be null.
        profileId - The ID of the profile that the image belongs to. Cannot be null.
        imageId - The ID of the image to be deleted. Cannot be null.
        reason - reason of termination
      • deleteImage

        void deleteImage​(@NotNull
                         String projectId,
                         @NotNull
                         String profileId,
                         @NotNull
                         String imageId)
        Deletes a cloud image with the specified imageId from a cloud profile
        Parameters:
        projectId - The ID of the project that the image belongs to. Cannot be null.
        profileId - The ID of the profile that the image belongs to. Cannot be null.
        imageId - The ID of the image to be deleted. Cannot be null.
      • disposeClientAndRemoveInstances

        void disposeClientAndRemoveInstances​(@NotNull
                                             String projectId,
                                             @NotNull
                                             String profileId,
                                             @NotNull
                                             TerminateInstanceReason reason)
        Disposes of the client associated to the cloud profile with the given project and profile IDs. Will terminate all running instances
        Parameters:
        projectId - the unique identifier of the project
        profileId - the unique identifier of the profile
        reason - reason of termination
        Since:
        2024.12
      • disposeClient

        void disposeClient​(@NotNull
                           String projectId,
                           @NotNull
                           String profileId)
        Disposes of the client associated to the cloud profile with the given project and profile IDs.
        Parameters:
        projectId - the unique identifier of the project
        profileId - the unique identifier of the profile
        Since:
        2024.12
      • findProfileByImageId

        @Nullable
        CloudProfile findProfileByImageId​(@NotNull
                                          String imageId)