Module: ApiRoutes
- Included in:
- ApiClient
- Defined in:
- lib/uffizzi/clients/api/api_routes.rb
Instance Method Summary collapse
- #access_token_url(server, code) ⇒ Object
- #access_tokens_url(server) ⇒ Object
- #account_can_install_uri(server, account_id) ⇒ Object
- #account_clusters_uri(server, account_id) ⇒ Object
- #account_controller_setting_uri(server, account_id, id) ⇒ Object
- #account_controller_settings_uri(server, account_id) ⇒ Object
- #account_projects_uri(server, account_id) ⇒ Object
- #account_uri(server, account_name) ⇒ Object
- #accounts_uri(server) ⇒ Object
- #activity_items_uri(server, project_slug, deployment_id) ⇒ Object
- #browser_sign_in_url(server, session_id) ⇒ Object
- #check_credential_uri(server, account_id, type) ⇒ Object
- #ci_session_uri(server) ⇒ Object
- #cluster_uri(server, project_slug, cluster_name:, oidc_token:) ⇒ Object
- #compose_file_uri(server, project_slug) ⇒ Object
- #create_projects_uri(server, account_id) ⇒ Object
- #credential_uri(server, account_id, credential_type) ⇒ Object
- #credentials_uri(server, account_id) ⇒ Object
- #deploy_containers_uri(server, project_slug, deployment_id) ⇒ Object
- #deployment_uri(server, project_slug, deployment_id) ⇒ Object
- #deployments_uri(server, project_slug, filter = nil) ⇒ Object
- #events_uri(server, project_slug, deployment_id) ⇒ Object
- #k8s_container_description_uri(server, project_slug, deployment_id, container_name) ⇒ Object
- #preview_service_logs_uri(server, project_slug, deployment_id, container_name) ⇒ Object
- #preview_services_uri(server, project_slug, deployment_id) ⇒ Object
- #project_cluster_ingresses_uri(server, project_slug, cluster_name:, oidc_token:) ⇒ Object
- #project_clusters_uri(server, project_slug, oidc_token:) ⇒ Object
- #project_uri(server, project_slug) ⇒ Object
- #projects_uri(server) ⇒ Object
- #scale_down_cluster_uri(server, project_slug, cluster_name) ⇒ Object
- #scale_up_cluster_uri(server, project_slug, cluster_name) ⇒ Object
- #secret_uri(server, project_slug, id) ⇒ Object
- #secrets_uri(server, project_slug) ⇒ Object
- #session_uri(server) ⇒ Object
- #sync_cluster_uri(server, project_slug, cluster_name) ⇒ Object
- #validate_compose_file_uri(server, project_slug) ⇒ Object
Instance Method Details
#access_token_url(server, code) ⇒ Object
135 136 137 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 135 def access_token_url(server, code) "#{server}/api/cli/v1/access_tokens/#{code}" end |
#access_tokens_url(server) ⇒ Object
139 140 141 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 139 def access_tokens_url(server) "#{server}/api/cli/v1/access_tokens" end |
#account_can_install_uri(server, account_id) ⇒ Object
14 15 16 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 14 def account_can_install_uri(server, account_id) "#{server}/api/cli/v1/accounts/#{account_id}/check_can_install" end |
#account_clusters_uri(server, account_id) ⇒ Object
147 148 149 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 147 def account_clusters_uri(server, account_id) "#{server}/api/cli/v1/accounts/#{account_id}/clusters" end |
#account_controller_setting_uri(server, account_id, id) ⇒ Object
155 156 157 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 155 def account_controller_setting_uri(server, account_id, id) "#{server}/api/cli/v1/accounts/#{account_id}/controller_settings/#{id}" end |
#account_controller_settings_uri(server, account_id) ⇒ Object
151 152 153 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 151 def account_controller_settings_uri(server, account_id) "#{server}/api/cli/v1/accounts/#{account_id}/controller_settings" end |
#account_projects_uri(server, account_id) ⇒ Object
30 31 32 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 30 def account_projects_uri(server, account_id) "#{server}/api/cli/v1/accounts/#{account_id}/projects" end |
#account_uri(server, account_name) ⇒ Object
10 11 12 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 10 def account_uri(server, account_name) "#{server}/api/cli/v1/accounts/#{account_name}" end |
#accounts_uri(server) ⇒ Object
6 7 8 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 6 def accounts_uri(server) "#{server}/api/cli/v1/accounts" end |
#activity_items_uri(server, project_slug, deployment_id) ⇒ Object
69 70 71 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 69 def activity_items_uri(server, project_slug, deployment_id) "#{server}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/activity_items" end |
#browser_sign_in_url(server, session_id) ⇒ Object
143 144 145 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 143 def browser_sign_in_url(server, session_id) "#{server}/sign_in?session_id=#{session_id}" end |
#check_credential_uri(server, account_id, type) ⇒ Object
81 82 83 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 81 def check_credential_uri(server, account_id, type) "#{server}/api/cli/v1/accounts/#{account_id}/credentials/#{type}/check_credential" end |
#ci_session_uri(server) ⇒ Object
51 52 53 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 51 def ci_session_uri(server) "#{server}/api/cli/v1/ci/session" end |
#cluster_uri(server, project_slug, cluster_name:, oidc_token:) ⇒ Object
117 118 119 120 121 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 117 def cluster_uri(server, project_slug, cluster_name:, oidc_token:) return "#{server}/api/cli/v1/projects/#{project_slug}/clusters/#{cluster_name}" if oidc_token.nil? "#{server}/api/cli/v1/projects/#{project_slug}/clusters/#{cluster_name}?token=#{oidc_token}" end |
#compose_file_uri(server, project_slug) ⇒ Object
18 19 20 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 18 def compose_file_uri(server, project_slug) "#{server}/api/cli/v1/projects/#{project_slug}/compose_file" end |
#create_projects_uri(server, account_id) ⇒ Object
34 35 36 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 34 def create_projects_uri(server, account_id) "#{server}/api/cli/v1/accounts/#{account_id}/projects" end |
#credential_uri(server, account_id, credential_type) ⇒ Object
93 94 95 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 93 def credential_uri(server, account_id, credential_type) "#{server}/api/cli/v1/accounts/#{account_id}/credentials/#{credential_type}" end |
#credentials_uri(server, account_id) ⇒ Object
85 86 87 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 85 def credentials_uri(server, account_id) "#{server}/api/cli/v1/accounts/#{account_id}/credentials" end |
#deploy_containers_uri(server, project_slug, deployment_id) ⇒ Object
73 74 75 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 73 def deploy_containers_uri(server, project_slug, deployment_id) "#{server}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/deploy_containers" end |
#deployment_uri(server, project_slug, deployment_id) ⇒ Object
65 66 67 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 65 def deployment_uri(server, project_slug, deployment_id) "#{server}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}" end |
#deployments_uri(server, project_slug, filter = nil) ⇒ Object
59 60 61 62 63 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 59 def deployments_uri(server, project_slug, filter = nil) return "#{server}/api/cli/v1/projects/#{project_slug}/deployments" if filter.nil? "#{server}/api/cli/v1/projects/#{project_slug}/deployments?q=#{filter.to_json}" end |
#events_uri(server, project_slug, deployment_id) ⇒ Object
77 78 79 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 77 def events_uri(server, project_slug, deployment_id) "#{server}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/events" end |
#k8s_container_description_uri(server, project_slug, deployment_id, container_name) ⇒ Object
101 102 103 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 101 def k8s_container_description_uri(server, project_slug, deployment_id, container_name) "#{server}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers/#{container_name}/k8s_container_description" end |
#preview_service_logs_uri(server, project_slug, deployment_id, container_name) ⇒ Object
97 98 99 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 97 def preview_service_logs_uri(server, project_slug, deployment_id, container_name) "#{server}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers/#{container_name}/logs" end |
#preview_services_uri(server, project_slug, deployment_id) ⇒ Object
89 90 91 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 89 def preview_services_uri(server, project_slug, deployment_id) "#{server}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers" end |
#project_cluster_ingresses_uri(server, project_slug, cluster_name:, oidc_token:) ⇒ Object
111 112 113 114 115 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 111 def project_cluster_ingresses_uri(server, project_slug, cluster_name:, oidc_token:) url = "#{server}/api/cli/v1/projects/#{project_slug}/clusters/#{cluster_name}/ingresses" oidc_token.nil? ? url : url + "?token=#{oidc_token}" end |
#project_clusters_uri(server, project_slug, oidc_token:) ⇒ Object
105 106 107 108 109 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 105 def project_clusters_uri(server, project_slug, oidc_token:) return "#{server}/api/cli/v1/projects/#{project_slug}/clusters" if oidc_token.nil? "#{server}/api/cli/v1/projects/#{project_slug}/clusters?token=#{oidc_token}" end |
#project_uri(server, project_slug) ⇒ Object
22 23 24 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 22 def project_uri(server, project_slug) "#{server}/api/cli/v1/projects/#{project_slug}" end |
#projects_uri(server) ⇒ Object
26 27 28 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 26 def projects_uri(server) "#{server}/api/cli/v1/projects" end |
#scale_down_cluster_uri(server, project_slug, cluster_name) ⇒ Object
127 128 129 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 127 def scale_down_cluster_uri(server, project_slug, cluster_name) "#{server}/api/cli/v1/projects/#{project_slug}/clusters/#{cluster_name}/scale_down" end |
#scale_up_cluster_uri(server, project_slug, cluster_name) ⇒ Object
123 124 125 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 123 def scale_up_cluster_uri(server, project_slug, cluster_name) "#{server}/api/cli/v1/projects/#{project_slug}/clusters/#{cluster_name}/scale_up" end |
#secret_uri(server, project_slug, id) ⇒ Object
38 39 40 41 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 38 def secret_uri(server, project_slug, id) path_id = CGI.escape(id) "#{server}/api/cli/v1/projects/#{project_slug}/secrets/#{path_id}" end |
#secrets_uri(server, project_slug) ⇒ Object
43 44 45 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 43 def secrets_uri(server, project_slug) "#{server}/api/cli/v1/projects/#{project_slug}/secrets" end |
#session_uri(server) ⇒ Object
47 48 49 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 47 def session_uri(server) "#{server}/api/cli/v1/session" end |
#sync_cluster_uri(server, project_slug, cluster_name) ⇒ Object
131 132 133 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 131 def sync_cluster_uri(server, project_slug, cluster_name) "#{server}/api/cli/v1/projects/#{project_slug}/clusters/#{cluster_name}/sync" end |
#validate_compose_file_uri(server, project_slug) ⇒ Object
55 56 57 |
# File 'lib/uffizzi/clients/api/api_routes.rb', line 55 def validate_compose_file_uri(server, project_slug) "#{compose_files_uri(server, project_slug)}/validate" end |