Portability | portable |
---|---|
Stability | experimental |
Maintainer | ricky@elrod.me |
Safe Haskell | None |
- data CoprConfig = CoprConfig {
- domain :: Hostname
- port :: Port
- login :: ByteString
- token :: ByteString
- type Username = ByteString
- defaultConfig :: CoprConfig
- withConfig :: CoprConfig -> (CoprConfig -> IO a) -> IO a
- addBuild :: Username -> ProjectName -> CoprBuild -> CoprConfig -> IO CoprBuildResponse
- buildStatus :: Int -> CoprConfig -> IO CoprStatusResponse
- coprs :: Username -> CoprConfig -> IO Coprs
- new :: Username -> CoprProject -> CoprConfig -> IO NewCoprResponse
Documentation
data CoprConfig Source
CoprConfig | |
|
type Username = ByteStringSource
withConfig :: CoprConfig -> (CoprConfig -> IO a) -> IO aSource
A utility wrapper for calling API methods with a CoprConfig
.
You can use this to do things like:
>>>
let c = defaultConfig { login = "your_login", token = "your_token" }
>>>
withConfig c $ coprs "codeblock"
:: Username | The username of the person who owns the copr project. |
-> ProjectName | The project to add the build to. |
-> CoprBuild | A representation of the build to add. |
-> CoprConfig | The configuration to use. |
-> IO CoprBuildResponse |
Add a build to a copr project.
This makes use of the /api/coprs[username]\[project]/new_build/
endpoint.
withConfig c $ addBuild "codeblock" "testproject" (CoprBuild (NEL.fromList ["http://example.com/foo-1.0.0.src.rpm"]) 2048 3600)
:: Int | The build ID number to check. |
-> CoprConfig | The configuration to use. |
-> IO CoprStatusResponse |
Check the status of a copr build
This makes use of the /api/coprs/build_status[build_id]\
endpoint.
withConfig c $ buildStatus 1033
:: Username | The username of the person whose projects we want to list. |
-> CoprConfig | The configuration to use. |
-> IO Coprs |
Retrieve a list of copr projects for an individual user.
This makes use of the /api/coprs[username]\
endpoint.
withConfig c $ coprs "codeblock"
:: Username | The username of the person whose project should be created. |
-> CoprProject | The copr project to be created. |
-> CoprConfig | The configuration to use. |
-> IO NewCoprResponse |
Create a new copr project.
This makes use of the /api/coprs[username]\new/
endpoint.
withConfig c $ new "codeblock" (CoprProject "testproject" [] [] (NEL.fromList ["fedora-20-x86_64"]))