| Safe Haskell | None |
|---|
Jenkins.REST
Contents
Description
Jenkins REST API interface
- data Jenkins a
- data Disconnect
- data Settings = Settings {}
- newtype Host = Host {}
- newtype Port = Port {}
- newtype User = User {
- unUser :: ByteString
- newtype APIToken = APIToken {}
- type Password = APIToken
- data Request
- get :: Method Complete f -> Jenkins ByteString
- post :: (forall f. Method Complete f) -> ByteString -> Jenkins ()
- post_ :: (forall f. Method Complete f) -> Jenkins ()
- concurrently :: Jenkins a -> Jenkins b -> Jenkins (a, b)
- io :: IO a -> Jenkins a
- disconnect :: Jenkins a
- with :: (Request -> Request) -> Jenkins a -> Jenkins a
- module Jenkins.REST.Method
- concurrentlys :: [Jenkins a] -> Jenkins [a]
- concurrentlys_ :: [Jenkins a] -> Jenkins ()
- postXML :: (forall f. Method Complete f) -> Document -> Jenkins ()
- reload :: Jenkins a
- restart :: Jenkins a
- runJenkins :: Settings -> Jenkins a -> IO (Either Disconnect a)
- runJenkinsP :: Monad m => (JenkinsF (m a) -> m a) -> Jenkins a -> m a
- jenkins_host :: Lens' Settings Host
- jenkins_port :: Lens' Settings Port
- jenkins_user :: Lens' Settings User
- jenkins_api_token :: Lens' Settings APIToken
- jenkins_password :: Lens' Settings Password
- _Host :: Prism' Host String
- _Port :: Prism' Port Int
- _User :: Prism' User ByteString
- _APIToken :: Prism' APIToken ByteString
- _Password :: Prism' Password ByteString
- module Jenkins.REST.Lens
Types
Jenkins REST API composable queries
Jenkins settings
_jenkins_api_token might as well be the user's password, Jenkins
does not make any distinction between these concepts
Constructors
| Settings | |
Fields | |
Jenkins host address
Jenkins port
Jenkins user
Constructors
| User | |
Fields
| |
Jenkins user API token
Constructors
| APIToken | |
Fields | |
data Request
All information on how to connect to a host and what should be sent in the HTTP request.
If you simply wish to download from a URL, see parseUrl.
The constructor for this data type is not exposed. Instead, you should use
either the def method to retrieve a default instance, or parseUrl to
construct from a URL, and then use the records below to make modifications.
This approach allows http-client to add configuration options without
breaking backwards compatibility.
For example, to construct a POST request, you could do something like:
initReq <- parseUrl "http://www.example.com/path"
let req = initReq
{ method = "POST"
}
For more information, please see http://www.yesodweb.com/book/settings-types.
Since 0.1.0
Jenkins queries construction
concurrently :: Jenkins a -> Jenkins b -> Jenkins (a, b)Source
Do both queries concurrently
disconnect :: Jenkins aSource
Disconnect from Jenkins
Following queries won't be executed
Jenkins method construction
module Jenkins.REST.Method
Little helpers
concurrentlys :: [Jenkins a] -> Jenkins [a]Source
Do a list of queries concurrently
concurrentlys_ :: [Jenkins a] -> Jenkins ()Source
Do a list of queries concurrently ignoring their results
postXML :: (forall f. Method Complete f) -> Document -> Jenkins ()Source
POST job's config.xml (in xml-conduit format)
Jenkins queries execution
runJenkins :: Settings -> Jenkins a -> IO (Either Disconnect a)Source
Communicate with Jenkins REST API
Catches HttpExceptions thrown by http-conduit, but
does not catch exceptions thrown by embedded IO actions
runJenkinsP :: Monad m => (JenkinsF (m a) -> m a) -> Jenkins a -> m aSource
Generic Jenkins REST API queries interpreter
Particularly useful for testing (with m ≡ )
Identity
Lenses and prisms
Usable http-conduit Request type API
module Jenkins.REST.Lens