Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Noah
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Noah
Commits
7a10fa79
Commit
7a10fa79
authored
Apr 12, 2011
by
John E. Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating routes for link operations
parent
8ba5a858
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
configuration_routes.rb
lib/noah/configuration_routes.rb
+8
-0
link_routes.rb
lib/noah/link_routes.rb
+2
-0
service_routes.rb
lib/noah/service_routes.rb
+16
-0
tag_routes.rb
lib/noah/tag_routes.rb
+1
-0
No files found.
lib/noah/configuration_routes.rb
View file @
7a10fa79
...
@@ -38,6 +38,14 @@ class Noah::App
...
@@ -38,6 +38,14 @@ class Noah::App
end
end
end
end
put
'/configurations/:configname/link'
do
|
configname
|
required_params
=
[
"link_name"
]
data
=
JSON
.
parse
(
request
.
body
.
read
)
(
data
.
keys
.
sort
==
required_params
.
sort
)
?
(
a
=
Noah
::
Configuration
.
find
(:
name
=>
configname
).
first
)
:
(
raise
"Missing Parameters"
)
a
.
nil?
?
(
halt
404
)
:
(
a
.
link!
data
[
"link_name"
])
a
.
to_json
end
put
'/configurations/:configname/tag'
do
|
configname
|
put
'/configurations/:configname/tag'
do
|
configname
|
required_params
=
[
"tags"
]
required_params
=
[
"tags"
]
data
=
JSON
.
parse
(
request
.
body
.
read
)
data
=
JSON
.
parse
(
request
.
body
.
read
)
...
...
lib/noah/link_routes.rb
View file @
7a10fa79
class
Noah
::
App
class
Noah
::
App
get
'/:link_name/:model_name/?'
do
|
path
,
model
|
get
'/:link_name/:model_name/?'
do
|
path
,
model
|
link_name
=
Noah
::
Link
.
find
(
:path
=>
"/"
+
path
).
first
link_name
=
Noah
::
Link
.
find
(
:path
=>
"/"
+
path
).
first
(
halt
404
)
if
link_name
.
nil?
(
halt
404
)
if
link_name
.
nil?
...
@@ -11,4 +12,5 @@ class Noah::App
...
@@ -11,4 +12,5 @@ class Noah::App
(
halt
404
)
if
link_name
.
nil?
(
halt
404
)
if
link_name
.
nil?
link_name
.
to_json
link_name
.
to_json
end
end
end
end
lib/noah/service_routes.rb
View file @
7a10fa79
...
@@ -22,6 +22,22 @@ class Noah::App
...
@@ -22,6 +22,22 @@ class Noah::App
services
.
to_json
services
.
to_json
end
end
put
'/services/:servicename/link'
do
|
appname
|
required_params
=
[
"link_name"
]
data
=
JSON
.
parse
(
request
.
body
.
read
)
(
data
.
keys
.
sort
==
required_params
.
sort
)
?
(
a
=
Noah
::
Service
.
find
(:
name
=>
servicename
).
first
)
:
(
raise
"Missing Parameters"
)
a
.
nil?
?
(
halt
404
)
:
(
a
.
link!
data
[
"link_name"
])
a
.
to_json
end
put
'/services/:servicename/:hostname/link'
do
|
servicename
,
hostname
|
required_params
=
[
"link_name"
]
data
=
JSON
.
parse
(
request
.
body
.
read
)
(
data
.
keys
.
sort
==
required_params
.
sort
)
?
(
a
=
host_service
(
hostname
,
servicename
))
:
(
raise
"Missing Parameters"
)
a
.
nil?
?
(
halt
404
)
:
(
a
.
link!
data
[
"link_name"
])
a
.
to_json
end
put
'/services/:servicename/:hostname/tag'
do
|
servicename
,
hostname
|
put
'/services/:servicename/:hostname/tag'
do
|
servicename
,
hostname
|
required_params
=
[
"tags"
]
required_params
=
[
"tags"
]
data
=
JSON
.
parse
(
request
.
body
.
read
)
data
=
JSON
.
parse
(
request
.
body
.
read
)
...
...
lib/noah/tag_routes.rb
View file @
7a10fa79
...
@@ -11,4 +11,5 @@ class Noah::App
...
@@ -11,4 +11,5 @@ class Noah::App
(
halt
404
)
if
tags
.
size
==
0
(
halt
404
)
if
tags
.
size
==
0
tags
.
to_json
tags
.
to_json
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment