Package com.webhookrelay.jenkins
Class WebhookRelayAPI
java.lang.Object
com.webhookrelay.jenkins.WebhookRelayAPI
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateBucket(String name) createFunction(String name, String driver, String source) Creates a function.createInput(String bucketId, String name) createOutput(String bucketId, String name, String destination) findBucketByName(String name) Returns the bucket matching the given name (or id), ornullif none exists.findOrCreateBucket(String name) Finds an existing bucket by name, creating it (with its default public input) if it does not exist.voidsetFunctionConfig(String functionId, String key, String value) Sets (creates or overwrites) a function configuration variable.voidsetInputFunction(String bucketId, String inputId, String functionId) Attaches a function to an input (or detaches it whenfunctionIdis empty).updateFunction(String id, String name, String driver, String source)
-
Constructor Details
-
WebhookRelayAPI
-
-
Method Details
-
listBuckets
- Throws:
IOException
-
getBucket
- Throws:
IOException
-
findBucketByName
Returns the bucket matching the given name (or id), ornullif none exists.- Throws:
IOException
-
findOrCreateBucket
Finds an existing bucket by name, creating it (with its default public input) if it does not exist. The returned bucket is always re-fetched so that the auto-created input (and its public endpoint URL) is populated.- Throws:
IOException
-
createBucket
- Throws:
IOException
-
createInput
- Throws:
IOException
-
createOutput
public WebhookRelayAPI.Output createOutput(String bucketId, String name, String destination) throws IOException - Throws:
IOException
-
listFunctions
- Throws:
IOException
-
createFunction
public WebhookRelayAPI.Function createFunction(String name, String driver, String source) throws IOException Creates a function. The source is sent base64-encoded, as the Go SDK does.- Throws:
IOException
-
updateFunction
public WebhookRelayAPI.Function updateFunction(String id, String name, String driver, String source) throws IOException - Throws:
IOException
-
setFunctionConfig
Sets (creates or overwrites) a function configuration variable.- Throws:
IOException
-
setInputFunction
Attaches a function to an input (or detaches it whenfunctionIdis empty). The input update API replaces the whole input, so the current input is re-read and sent back with onlyfunction_idchanged.- Throws:
IOException
-