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

src.main.kotlin.com.gabrielfeo.develocity.api.BuildCacheApi.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.KeySecretPair
import com.gabrielfeo.develocity.api.model.NodeConfiguration

@JvmSuppressWildcards
interface BuildCacheApi {
    /**
     * Create or update a Build Cache Node.
     * Create a new Build Cache Node in Develocity or update the configuration of an existing one. The Built-in Build Cache Node cannot be named as the target of this operation. 
     * Responses:
     *  - 200: The name referenced an existing Build Cache Node and that Build Cache Node’s configuration was updated successfully.
     *  - 201: A new Build Cache Node was created with the configuration specified in the request.
     *  - 400: The request cannot be fulfilled due to a problem.
     *  - 404: The referenced resource either does not exist or the permissions to know about it are missing.
     *
     * @param name The name of the Build Cache Node. To select the Built-in Build Cache Node, use `Built-in` as name.
     * @param nodeConfiguration 
     * @return [Unit]
     */
    @PUT("api/build-cache/nodes/{name}")
    suspend fun createOrUpdateBuildCacheNode(@Path("name") name: kotlin.String, @Body nodeConfiguration: NodeConfiguration): Unit

    /**
     * View the configuration of a Build Cache Node.
     * View the enablement status and replication configuration of a Build Cache Node.
     * Responses:
     *  - 200: The configuration of a Build Cache Node.
     *  - 404: The referenced resource either does not exist or the permissions to know about it are missing.
     *  - 500: The server encountered an unexpected error.
     *
     * @param name The name of the Build Cache Node. To select the Built-in Build Cache Node, use `Built-in` as name.
     * @return [NodeConfiguration]
     */
    @GET("api/build-cache/nodes/{name}")
    suspend fun getBuildCacheNode(@Path("name") name: kotlin.String): NodeConfiguration

    /**
     * Deletes all entries from a Build Cache Node.
     * Triggers the deletion of all entries stored at the named Build Cache Node. 
     * Responses:
     *  - 202: Purging the Build Cache Node was successfully initiated.
     *  - 404: The referenced resource either does not exist or the permissions to know about it are missing.
     *  - 500: The server encountered an unexpected error.
     *  - 503: The node was not signed in with Develocity.
     *
     * @param name The name of the Build Cache Node. To select the Built-in Build Cache Node, use `Built-in` as name.
     * @return [Unit]
     */
    @POST("api/build-cache/nodes/{name}/purge")
    suspend fun initiatePurgeOfBuildCacheNode(@Path("name") name: kotlin.String): Unit

    /**
     * Regenerate the secret of a Build Cache Node.
     * Regenerates the secret associated with the named Build Cache Node. The old secret expires immediately, causing the Build Cache Node to disconnect from Develocity. The Built-in Build Cache Node cannot be named as the target of this operation. 
     * Responses:
     *  - 200: The name referenced an existing Build Cache Node and that Build Cache Node's secret was regenerated.
     *  - 404: The referenced resource either does not exist or the permissions to know about it are missing.
     *  - 500: The server encountered an unexpected error.
     *
     * @param name The name of the Build Cache Node.
     * @return [KeySecretPair]
     */
    @POST("api/build-cache/nodes/{name}/secret")
    suspend fun regenerateSecretOfBuildCacheNode(@Path("name") name: kotlin.String): KeySecretPair

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy