diff options
Diffstat (limited to 'app/views/api/agents')
| -rw-r--r-- | app/views/api/agents/create.json.jbuilder | 1 | ||||
| -rw-r--r-- | app/views/api/agents/files/index.json.jbuilder | 4 | ||||
| -rw-r--r-- | app/views/api/agents/files/show.json.jbuilder | 6 | ||||
| -rw-r--r-- | app/views/api/agents/index.json.jbuilder | 4 |
4 files changed, 15 insertions, 0 deletions
diff --git a/app/views/api/agents/create.json.jbuilder b/app/views/api/agents/create.json.jbuilder new file mode 100644 index 0000000..f156cb0 --- /dev/null +++ b/app/views/api/agents/create.json.jbuilder @@ -0,0 +1 @@ +json.extract! @agent, :id, :hostname, :created_at, :updated_at diff --git a/app/views/api/agents/files/index.json.jbuilder b/app/views/api/agents/files/index.json.jbuilder new file mode 100644 index 0000000..6551a44 --- /dev/null +++ b/app/views/api/agents/files/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@files) do |file| + json.extract! agent, :fingerprint, :state + json.url agent_file_url([agent, file], format: :json) +end diff --git a/app/views/api/agents/files/show.json.jbuilder b/app/views/api/agents/files/show.json.jbuilder new file mode 100644 index 0000000..8c6f501 --- /dev/null +++ b/app/views/api/agents/files/show.json.jbuilder @@ -0,0 +1,6 @@ +if @file + json.extract! @file, :fingerprint, :state +else + json.fingerprint @fingerprint + json.state "unknown" +end diff --git a/app/views/api/agents/index.json.jbuilder b/app/views/api/agents/index.json.jbuilder new file mode 100644 index 0000000..65f6f60 --- /dev/null +++ b/app/views/api/agents/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@agents) do |agent| + json.extract! agent, :id, :hostname + json.url agent_url(agent, format: :json) +end |
