Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
aff363a4
Commit
aff363a4
authored
15 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Drop RAPI v1 compatiblity
Since we only support Ganeti 2.0, we drop the 1.2 compatibility.
parent
00b15752
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ganeti/HTools/Rapi.hs
+14
-28
14 additions, 28 deletions
Ganeti/HTools/Rapi.hs
with
14 additions
and
28 deletions
Ganeti/HTools/Rapi.hs
+
14
−
28
View file @
aff363a4
...
...
@@ -33,37 +33,23 @@ getUrl url = do
_
->
Left
$
printf
"Curl error for '%s', error %s"
url
(
show
code
))
tryRapi
::
String
->
String
->
IO
(
Either
String
String
)
tryRapi
url1
url2
=
do
body1
<-
getUrl
url1
(
case
body1
of
Left
_
->
getUrl
url2
Right
_
->
return
body1
)
getInstances
::
String
->
IO
(
Either
String
String
)
getInstances
master
=
let
url2
=
printf
"https://%s:5080/2/instances?bulk=1"
master
url1
=
printf
"http://%s:5080/instances?bulk=1"
master
in
do
body
<-
tryRapi
url1
url2
let
inst
=
body
`
combineEithers
`
loadJSArray
`
combineEithers
`
(
parseEitherList
parseInstance
)
return
inst
getInstances
master
=
do
let
url2
=
printf
"https://%s:5080/2/instances?bulk=1"
master
body
<-
getUrl
url2
let
inst
=
body
`
combineEithers
`
loadJSArray
`
combineEithers
`
(
parseEitherList
parseInstance
)
return
inst
getNodes
::
String
->
IO
(
Either
String
String
)
getNodes
master
=
let
url2
=
printf
"https://%s:5080/2/nodes?bulk=1"
master
url1
=
printf
"http://%s:5080/nodes?bulk=1"
master
in
do
body
<-
tryRapi
url1
url2
let
inst
=
body
`
combineEithers
`
loadJSArray
`
combineEithers
`
(
parseEitherList
parseNode
)
return
inst
getNodes
master
=
do
let
url2
=
printf
"https://%s:5080/2/nodes?bulk=1"
master
body
<-
getUrl
url2
let
inst
=
body
`
combineEithers
`
loadJSArray
`
combineEithers
`
(
parseEitherList
parseNode
)
return
inst
parseInstance
::
JSObject
JSValue
->
Either
String
String
parseInstance
a
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment