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
a0dcf7c2
Commit
a0dcf7c2
authored
16 years ago
by
Oleksiy Mishchenko
Browse files
Options
Downloads
Patches
Plain Diff
RAPI: Switch from opcodes to no native 2.0 queries.
Reviewed-by: imsnah
parent
b7cb9024
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/rapi/connector.py
+2
-2
2 additions, 2 deletions
lib/rapi/connector.py
lib/rapi/rlib2.py
+11
-13
11 additions, 13 deletions
lib/rapi/rlib2.py
with
13 additions
and
15 deletions
lib/rapi/connector.py
+
2
−
2
View file @
a0dcf7c2
...
...
@@ -125,11 +125,11 @@ CONNECTOR.update({
"
/tags
"
:
rlib1
.
R_tags
,
"
/info
"
:
rlib1
.
R_info
,
"
/nodes
"
:
rlib
1
.
R_nodes
,
"
/nodes
"
:
rlib
2
.
R_
2_
nodes
,
re
.
compile
(
r
'
^/nodes/([\w\._-]+)$
'
):
rlib1
.
R_nodes_name
,
re
.
compile
(
r
'
^/nodes/([\w\._-]+)/tags$
'
):
rlib1
.
R_nodes_name_tags
,
"
/instances
"
:
rlib
1
.
R_instances
,
"
/instances
"
:
rlib
2
.
R_
2_
instances
,
re
.
compile
(
r
'
^/instances/([\w\._-]+)$
'
):
rlib1
.
R_instances_name
,
re
.
compile
(
r
'
^/instances/([\w\._-]+)/tags$
'
):
rlib1
.
R_instances_name_tags
,
...
...
This diff is collapsed.
Click to expand it.
lib/rapi/rlib2.py
+
11
−
13
View file @
a0dcf7c2
...
...
@@ -128,14 +128,13 @@ class R_2_nodes(baserlib.R_Generic):
]
"""
op
=
ganeti
.
opcodes
.
OpQueryNodes
(
output_fields
=
[
"
name
"
],
names
=
[])
nodeslist
=
baserlib
.
ExtractField
(
ganeti
.
cli
.
SubmitOpCode
(
op
),
0
)
client
=
luxi
.
Client
()
nodesdata
=
client
.
QueryNodes
([],
[
"
name
"
])
nodeslist
=
[
row
[
0
]
for
row
in
nodesdata
]
if
'
bulk
'
in
self
.
queryargs
:
op
=
ganeti
.
opcodes
.
OpQueryNodes
(
output_fields
=
N_FIELDS
,
names
=
nodeslist
)
result
=
ganeti
.
cli
.
SubmitOpCode
(
op
)
return
baserlib
.
MapBulkFields
(
result
,
N_FIELDS
)
bulkdata
=
client
.
QueryNodes
(
nodeslist
,
N_FIELDS
)
return
baserlib
.
MapBulkFields
(
bulkdata
,
N_FIELDS
)
return
baserlib
.
BuildUriList
(
nodeslist
,
"
/2/nodes/%s
"
,
uri_fields
=
(
"
id
"
,
"
uri
"
))
...
...
@@ -190,15 +189,14 @@ class R_2_instances(baserlib.R_Generic):
]
"""
op
=
ganeti
.
opcodes
.
OpQueryInstances
(
output_fields
=
[
"
name
"
],
names
=
[])
instanceslist
=
baserlib
.
ExtractField
(
ganeti
.
cli
.
SubmitOpCode
(
op
),
0
)
client
=
luxi
.
Client
()
instancesdata
=
client
.
QueryInstances
([],
[
"
name
"
])
instanceslist
=
[
row
[
0
]
for
row
in
instancesdata
]
if
'
bulk
'
in
self
.
queryargs
:
op
=
ganeti
.
opcodes
.
OpQueryInstances
(
output_fields
=
I_FIELDS
,
names
=
instanceslist
)
result
=
ganeti
.
cli
.
SubmitOpCode
(
op
)
return
baserlib
.
MapBulkFields
(
result
,
I_FIELDS
)
if
'
bulk
'
in
self
.
queryargs
:
bulkdata
=
client
.
QueryInstances
(
instanceslist
,
I_FIELDS
)
return
baserlib
.
MapBulkFields
(
bulkdata
,
I_FIELDS
)
else
:
return
baserlib
.
BuildUriList
(
instanceslist
,
"
/2/instances/%s
"
,
...
...
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