21123: Add container_status to discovery doc.
authorTom Clegg <tom@curii.com>
Wed, 13 Mar 2024 03:27:36 +0000 (23:27 -0400)
committerTom Clegg <tom@curii.com>
Wed, 13 Mar 2024 03:27:36 +0000 (23:27 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

sdk/python/arvados-v1-discovery.json
services/api/app/controllers/arvados/v1/container_requests_controller.rb

index 6793893ff1204d6d3bf6ce98c76d00929ccfc055..232c88d0678eff48e64c366f386f549e62ed9c74 100644 (file)
             "https://api.arvados.org/auth/arvados"
           ]
         },
+        "container_status": {
+          "id": "arvados.container_requests.container_status",
+          "path": "container_requests/{uuid}/container_status",
+          "httpMethod": "GET",
+          "description": "container_status container_requests",
+          "parameters": {
+            "uuid": {
+              "type": "string",
+              "required": true,
+              "description": "The UUID of the ContainerRequest in question.",
+              "location": "query"
+            }
+          },
+          "response": {
+            "$ref": "ContainerRequest"
+          },
+          "scopes": [
+            "https://api.arvados.org/auth/arvados"
+          ]
+        },
         "list": {
           "id": "arvados.container_requests.list",
           "path": "container_requests",
index 6b6e96a1f71cb4f86444c74d720a8eb19711004a..f99a0a55a92671c0d455b6704f733551658a7fb4 100644 (file)
@@ -31,6 +31,22 @@ class Arvados::V1::ContainerRequestsController < ApplicationController
       })
   end
 
+  def self._container_status_requires_parameters
+    (super rescue {}).
+      merge({
+        uuid: {
+          type: 'string', required: true, description: "The UUID of the ContainerRequest in question.",
+        },
+      })
+  end
+
+  # This API is handled entirely by controller, so this method is
+  # never called -- it's only here for the sake of adding the API to
+  # the generated discovery document.
+  def container_status
+    send_json({"errors" => "controller-only API, not handled by rails"}, status: 400)
+  end
+
   def update
     if (resource_attrs.keys.map(&:to_sym) - [:owner_uuid, :name, :description, :properties]).empty? or @object.container_uuid.nil?
       # If no attributes are being updated besides these, there are no