Sha256: d070577ad0885fc58cecce75780cb839df31b7ebbaa2621859a2d7170ebf5cb2

Contents?: true

Size: 1.7 KB

Versions: 7

Compression:

Stored size: 1.7 KB

Contents

# frozen_string_literal: true

require 'cgi'

module ApiRoutes
  def compose_file_uri(hostname, project_slug)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/compose_file"
  end

  def projects_uri(hostname)
    "#{hostname}/api/cli/v1/projects"
  end

  def secret_uri(hostname, project_slug, id)
    path_id = CGI.escape(id)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/secrets/#{path_id}"
  end

  def secrets_uri(hostname, project_slug)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/secrets"
  end

  def session_uri(hostname)
    "#{hostname}/api/cli/v1/session"
  end

  def validate_compose_file_uri(hostname, project_slug)
    "#{compose_files_uri(hostname, project_slug)}/validate"
  end

  def deployments_uri(hostname, project_slug)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments"
  end

  def deployment_uri(hostname, project_slug, deployment_id)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}"
  end

  def activity_items_uri(hostname, project_slug, deployment_id)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/activity_items"
  end

  def deploy_containers_uri(hostname, project_slug, deployment_id)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/deploy_containers"
  end

  def events_uri(hostname, project_slug, deployment_id)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/events"
  end

  def credentials_uri(hostname)
    "#{hostname}/api/cli/v1/account/credentials"
  end

  def preview_services_uri(hostname, project_slug, deployment_id)
    "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
uffizzi-cli-0.3.8 lib/uffizzi/clients/api/api_routes.rb
uffizzi-cli-0.3.7 lib/uffizzi/clients/api/api_routes.rb
uffizzi-cli-0.3.6 lib/uffizzi/clients/api/api_routes.rb
uffizzi-cli-0.3.5 lib/uffizzi/clients/api/api_routes.rb
uffizzi-cli-0.3.4 lib/uffizzi/clients/api/api_routes.rb
uffizzi-cli-0.3.3 lib/uffizzi/clients/api/api_routes.rb
uffizzi-cli-0.3.2 lib/uffizzi/clients/api/api_routes.rb