All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.main.kotlin.com.gabrielfeo.develocity.api.TestDistributionApi.kt Maven / Gradle / Ivy

The newest version!
package com.gabrielfeo.develocity.api

import com.gabrielfeo.develocity.api.internal.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json

import com.gabrielfeo.develocity.api.model.ApiProblem
import com.gabrielfeo.develocity.api.model.TestDistributionAgentPoolConfiguration
import com.gabrielfeo.develocity.api.model.TestDistributionAgentPoolConfigurationWithId
import com.gabrielfeo.develocity.api.model.TestDistributionAgentPoolPage
import com.gabrielfeo.develocity.api.model.TestDistributionAgentPoolRegistrationKey
import com.gabrielfeo.develocity.api.model.TestDistributionAgentPoolRegistrationKeyDescription
import com.gabrielfeo.develocity.api.model.TestDistributionAgentPoolRegistrationKeyPrefix
import com.gabrielfeo.develocity.api.model.TestDistributionAgentPoolRegistrationKeyPrefixPage
import com.gabrielfeo.develocity.api.model.TestDistributionAgentPoolStatus

@JvmSuppressWildcards
interface TestDistributionApi {
    /**
     * Create or update an Agent Pool.
     * Create a new Agent Pool in Develocity or update the configuration of an existing one. The orderIndex element is optional and can be used to specify the priority order in which the Agent Pool is considered. When not specified, the Agent Pool will be either added last on creation, or will not change position on update. When specified, the Agent Pool will be added at/moved to the specified index and all other Agent Pools will be moved down. If the specified index is out of bounds, the Agent Pool will be added last with the orderIndex adjusted accordingly. 
     * Responses:
     *  - 200: The Agent Pool was created or its configuration was updated successfully.
     *  - 400: The request body is malformed or contains invalid values for at least one of the properties.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @param testDistributionAgentPoolConfiguration 
     * @return [TestDistributionAgentPoolConfigurationWithId]
     */
    @PUT("api/test-distribution/agent-pools/{poolId}")
    suspend fun createOrUpdateTestDistributionAgentPool(@Path("poolId") poolId: kotlin.String, @Body testDistributionAgentPoolConfiguration: TestDistributionAgentPoolConfiguration): TestDistributionAgentPoolConfigurationWithId

    /**
     * Create an Agent Pool.
     * Create a new Agent Pool in Develocity. The orderIndex element is optional and can be used to specify the priority order in which the Agent Pool is considered. When not specified, the Agent Pool will be added last. When specified, the Agent Pool will be added at the specified index and all other Agent Pools will be moved down. If the specified index is out of bounds, the Agent Pool will be added last with the orderIndex adjusted accordingly. 
     * Responses:
     *  - 200: A new Agent Pool was created with the configuration specified in the request.
     *  - 400: The request body is malformed or contains invalid values for at least one of the properties.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param testDistributionAgentPoolConfiguration 
     * @return [TestDistributionAgentPoolConfigurationWithId]
     */
    @POST("api/test-distribution/agent-pools")
    suspend fun createTestDistributionAgentPool(@Body testDistributionAgentPoolConfiguration: TestDistributionAgentPoolConfiguration): TestDistributionAgentPoolConfigurationWithId

    /**
     * Delete an Agent Pool.
     * Delete an existing Agent Pool.
     * Responses:
     *  - 200: The poolId referenced an existing Agent Pool and it was deleted.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @return [Unit]
     */
    @DELETE("api/test-distribution/agent-pools/{poolId}")
    suspend fun deleteTestDistributionAgentPool(@Path("poolId") poolId: kotlin.String): Unit

    /**
     * Generate a new Test Distribution pool-specific agent registration key.
     * Generate a new Test Distribution pool-specific agent registration key to connect agents and query the agent pool API.
     * Responses:
     *  - 200: A new registration key was successfully generated and contained in the response.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @param testDistributionAgentPoolRegistrationKeyDescription  (optional)
     * @return [TestDistributionAgentPoolRegistrationKey]
     */
    @POST("api/test-distribution/agent-pools/{poolId}/registration-keys")
    suspend fun generateTestDistributionAgentPoolRegistrationKey(@Path("poolId") poolId: kotlin.String, @Body testDistributionAgentPoolRegistrationKeyDescription: TestDistributionAgentPoolRegistrationKeyDescription? = null): TestDistributionAgentPoolRegistrationKey

    /**
     * View the properties of an Agent Pool
     * View the identifier, capabilities and size of an Agent Pool.
     * Responses:
     *  - 200: The poolId referenced an existing Agent Pool whose configuration is described in the response.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @return [TestDistributionAgentPoolConfigurationWithId]
     */
    @GET("api/test-distribution/agent-pools/{poolId}")
    suspend fun getTestDistributionAgentPool(@Path("poolId") poolId: kotlin.String): TestDistributionAgentPoolConfigurationWithId

    /**
     * Get a Test Distribution pool-specific agent registration keyPrefix information.
     * Returns information about a Test Distribution pool-specific agent registration keyPrefix.
     * Responses:
     *  - 200: The response contains information about the requested Test Distribution pool-specific agent registration keyPrefix.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @param keyPrefix The prefix of the Test Distribution pool-specific agent registration key.
     * @return [TestDistributionAgentPoolRegistrationKeyPrefix]
     */
    @GET("api/test-distribution/agent-pools/{poolId}/registration-keys/{keyPrefix}")
    suspend fun getTestDistributionAgentPoolRegistrationKey(@Path("poolId") poolId: kotlin.String, @Path("keyPrefix") keyPrefix: kotlin.String): TestDistributionAgentPoolRegistrationKeyPrefix

    /**
     * View the status of an Agent Pool
     * View the status of an Agent Pool, such as its current size. To access this endpoint the user requires the `Test Distribution` permission. 
     * Responses:
     *  - 200: The poolId referenced an existing Agent Pool whose status is described in the response.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @return [TestDistributionAgentPoolStatus]
     */
    @GET("api/test-distribution/agent-pools/{poolId}/status")
    suspend fun getTestDistributionAgentPoolStatus(@Path("poolId") poolId: kotlin.String): TestDistributionAgentPoolStatus

    /**
     * Insert a specific Test Distribution pool-specific agent registration key.
     * Inserts a specific Test Distribution pool-specific agent registration key to connect agents and query the agent pool API. If a key with the same prefix but different key already exists (regardless of which pool it belongs to), it will return 400. 
     * Responses:
     *  - 200: The registration key was successfully inserted.
     *  - 400: The request body is malformed or contains invalid values for at least one of the properties.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @param keyPrefix The prefix of the Test Distribution pool-specific agent registration key.
     * @param testDistributionAgentPoolRegistrationKey 
     * @return [TestDistributionAgentPoolRegistrationKeyPrefix]
     */
    @PUT("api/test-distribution/agent-pools/{poolId}/registration-keys/{keyPrefix}")
    suspend fun insertTestDistributionAgentPoolRegistrationKey(@Path("poolId") poolId: kotlin.String, @Path("keyPrefix") keyPrefix: kotlin.String, @Body testDistributionAgentPoolRegistrationKey: TestDistributionAgentPoolRegistrationKey): TestDistributionAgentPoolRegistrationKeyPrefix

    /**
     * Lists Test Distribution pool-specific agent registration keys.
     * Returns a list of all Test Distribution pool-specific agent registration key prefixes.
     * Responses:
     *  - 200: The response contains a listing of the requested type of (active or revoked) Test Distribution pool-specific agent registration key.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @return [TestDistributionAgentPoolRegistrationKeyPrefixPage]
     */
    @GET("api/test-distribution/agent-pools/{poolId}/registration-keys")
    suspend fun listTestDistributionAgentPoolRegistrationKeys(@Path("poolId") poolId: kotlin.String): TestDistributionAgentPoolRegistrationKeyPrefixPage

    /**
     * Lists Agent Pools.
     * Returns a list of all Agent Pools.
     * Responses:
     *  - 200: The response contains a listing of all Agent Pools.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @return [TestDistributionAgentPoolPage]
     */
    @GET("api/test-distribution/agent-pools")
    suspend fun listTestDistributionAgentPools(): TestDistributionAgentPoolPage

    /**
     * Revoke a Test Distribution pool-specific agent registration key.
     * Revoke the Test Distribution pool-specific agent registration key for the given prefix which uniquely identifies a Test Distribution pool-specific agent registration key. A revoked key can no longer be used to connect agents, but it will still be queryable and returned in the list. 
     * Responses:
     *  - 200: The registration key was revoked successfully.
     *  - 403: The authenticated user has insufficient permissions.
     *  - 404: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.
     *
     * @param poolId The ID of the pool to view.
     * @param keyPrefix The prefix of the Test Distribution pool-specific agent registration key.
     * @return [Unit]
     */
    @DELETE("api/test-distribution/agent-pools/{poolId}/registration-keys/{keyPrefix}")
    suspend fun revokeTestDistributionAgentPoolRegistrationKey(@Path("poolId") poolId: kotlin.String, @Path("keyPrefix") keyPrefix: kotlin.String): Unit

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy