Class: UffizziCore::Api::Cli::V1::Projects::Deployments::ContainersController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/uffizzi_core/api/cli/v1/projects/deployments/containers_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject

Get a list of container services for a deployment



19
20
21
22
23
# File 'app/controllers/uffizzi_core/api/cli/v1/projects/deployments/containers_controller.rb', line 19

def index
  containers = resource_deployment.containers.active

  respond_with containers
end

#k8s_container_descriptionObject



25
26
27
28
29
30
31
# File 'app/controllers/uffizzi_core/api/cli/v1/projects/deployments/containers_controller.rb', line 25

def k8s_container_description
  deployment ||= resource_project.deployments.enabled.find(params[:deployment_id])
  container = deployment.containers.active.find_by!(service_name: params[:container_name])
  last_state = UffizziCore::ContainerService.last_state(container)

  render json: { last_state: last_state }
end