| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Jenkins.Rest.Method
Description
Jenkins REST API methods
Synopsis
- text :: Text -> Method 'Complete f
- int :: Int -> Method 'Complete f
- (-/-) :: Method 'Complete f -> Method 'Complete f -> Method 'Complete f
- (-=-) :: Text -> Text -> Method 'Query f
- (-&-) :: Method 'Query f -> Method 'Query f -> Method 'Query f
- query :: [(Text, Maybe Text)] -> Method 'Query f
- (-?-) :: Method 'Complete f -> Method 'Query f -> Method 'Complete f
- data Formatter g
- json :: Formatter 'Json
- xml :: Formatter 'Xml
- python :: Formatter 'Python
- plain :: Formatter f
- job :: Text -> Method 'Complete f
- build :: Text -> Int -> Method 'Complete f
- view :: Text -> Method 'Complete f
- queue :: Method 'Complete f
- overallLoad :: Method 'Complete f
- computer :: Method 'Complete f
- data Method :: Type -> Format -> *
- data Type
- data Format
Construct URLs
Path
text :: Text -> Method 'Complete f Source #
Use a string as an URI segment
>>>pp (text "foo")"foo"
Note: with -XOverloadedStrings extension enabled it's possible to use string
literals as segments of the Jenkins API method URL
>>>pp' "foo""foo"
Note: don't put / in the string literal unless you want it URL-encoded,
use (-/-) instead
>>>pp' "foo/bar""foo%2Fbar"
(-/-) :: Method 'Complete f -> Method 'Complete f -> Method 'Complete f infixr 5 Source #
Combine two paths
>>>pp ("foo" -/- "bar" -/- "baz")"foo/bar/baz"
Query
(-=-) :: Text -> Text -> Method 'Query f infix 7 Source #
Make a key-value pair
>>>pp ("foo" -=- "bar")"foo=bar"
(-&-) :: Method 'Query f -> Method 'Query f -> Method 'Query f infixr 5 Source #
Create the union of two queries
>>>pp ("foo" -=- "bar" -&- "baz")"foo=bar&baz"
query :: [(Text, Maybe Text)] -> Method 'Query f Source #
Take a list of key-value pairs and render them as a query
>>>pp (query [("foo", Nothing), ("bar", Just "baz"), ("quux", Nothing)])"foo&bar=baz&quux"
>>>pp (query [])""
Put together the segments and the query
(-?-) :: Method 'Complete f -> Method 'Query f -> Method 'Complete f infix 1 Source #
Put path and query together
>>>pp ("qux" -/- "quux" -?- "foo" -=- "bar" -&- "baz")"qux/quux?foo=bar&baz"
>>>pp ("" -?- "foo" -=- "bar")"foo=bar"
>>>pp ("/" -?- "foo" -=- "bar")"%2F?foo=bar"
Format
json :: Formatter 'Json Source #
Append the JSON formatting request to the method URL
>>>format json "foo""foo/api/json"
xml :: Formatter 'Xml Source #
Append the XML formatting request to the method URL
>>>format xml "foo""foo/api/xml"
python :: Formatter 'Python Source #
Append the Python formatting request to the method URL
>>>format python "foo""foo/api/python"
Shortcuts
job :: Text -> Method 'Complete f Source #
Job data
>>>format json (job "name")"job/name/api/json"
>>>pp (job "name" -/- "config.xml")"job/name/config.xml"
build :: Text -> Int -> Method 'Complete f Source #
Job build data
>>>format json (build "name" 4)"job/name/4/api/json"
view :: Text -> Method 'Complete f Source #
View data
>>>format xml (view "name")"view/name/api/xml"
overallLoad :: Method 'Complete f Source #
Server statistics
>>>format xml overallLoad"overallLoad/api/xml"
Types
data Method :: Type -> Format -> * Source #
Jenkins RESTFul API method encoding
Instances
| IsString (Method 'Complete f) Source # | |
Defined in Jenkins.Rest.Method.Internal Methods fromString :: String -> Method 'Complete f # | |
| IsString (Method 'Query f) Source # | |
Defined in Jenkins.Rest.Method.Internal Methods fromString :: String -> Method 'Query f # | |
| t ~ 'Complete => Num (Method t f) Source # | Only to support numeric literals |
Defined in Jenkins.Rest.Method.Internal | |
| Show (SFormat f) => Show (Method t f) Source # | |
Method types
Instances
| Data Type Source # | |
Defined in Jenkins.Rest.Method.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type -> c Type # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Type # dataTypeOf :: Type -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Type) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type) # gmapT :: (forall b. Data b => b -> b) -> Type -> Type # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r # gmapQ :: (forall d. Data d => d -> u) -> Type -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Type -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type -> m Type # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type # | |
| Show Type Source # | |
| Eq Type Source # | |
Response formats
Instances
| Data Format Source # | |
Defined in Jenkins.Rest.Method.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Format -> c Format # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Format # toConstr :: Format -> Constr # dataTypeOf :: Format -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Format) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Format) # gmapT :: (forall b. Data b => b -> b) -> Format -> Format # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Format -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Format -> r # gmapQ :: (forall d. Data d => d -> u) -> Format -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Format -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Format -> m Format # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Format -> m Format # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Format -> m Format # | |
| Show Format Source # | |
| Eq Format Source # | |