mtncloud-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.dockerignore +20 -0
- data/.github/pull_request_template.md +14 -0
- data/.github/workflows/ci.yml +56 -0
- data/.github/workflows/release.yml +46 -0
- data/.gitignore +25 -0
- data/CLAUDE.md +24 -0
- data/CONTRIBUTING.md +91 -0
- data/Dockerfile +19 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +23 -0
- data/README.md +187 -0
- data/Rakefile +26 -0
- data/bin/mcs +3 -0
- data/bin/mtncloud +27 -0
- data/lib/mtncloud/api/account_groups_interface.rb +48 -0
- data/lib/mtncloud/api/account_users_interface.rb +68 -0
- data/lib/mtncloud/api/accounts_interface.rb +9 -0
- data/lib/mtncloud/api/activity_interface.rb +9 -0
- data/lib/mtncloud/api/affinity_groups_interface.rb +46 -0
- data/lib/mtncloud/api/api_client.rb +1091 -0
- data/lib/mtncloud/api/appliance_settings_interface.rb +49 -0
- data/lib/mtncloud/api/approvals_interface.rb +32 -0
- data/lib/mtncloud/api/apps_interface.rb +180 -0
- data/lib/mtncloud/api/archive_buckets_interface.rb +116 -0
- data/lib/mtncloud/api/archive_files_interface.rb +173 -0
- data/lib/mtncloud/api/audit_interface.rb +9 -0
- data/lib/mtncloud/api/auth_interface.rb +58 -0
- data/lib/mtncloud/api/backup_jobs_interface.rb +13 -0
- data/lib/mtncloud/api/backup_restores_interface.rb +27 -0
- data/lib/mtncloud/api/backup_results_interface.rb +32 -0
- data/lib/mtncloud/api/backup_service_types_interface.rb +9 -0
- data/lib/mtncloud/api/backup_services_interface.rb +9 -0
- data/lib/mtncloud/api/backup_settings_interface.rb +20 -0
- data/lib/mtncloud/api/backup_types_interface.rb +9 -0
- data/lib/mtncloud/api/backups_interface.rb +21 -0
- data/lib/mtncloud/api/billing_interface.rb +34 -0
- data/lib/mtncloud/api/blueprints_interface.rb +70 -0
- data/lib/mtncloud/api/body_io.rb +22 -0
- data/lib/mtncloud/api/budgets_interface.rb +48 -0
- data/lib/mtncloud/api/catalog_item_types_interface.rb +29 -0
- data/lib/mtncloud/api/certificate_types_interface.rb +14 -0
- data/lib/mtncloud/api/certificates_interface.rb +9 -0
- data/lib/mtncloud/api/clients_interface.rb +41 -0
- data/lib/mtncloud/api/cloud_datastores_interface.rb +48 -0
- data/lib/mtncloud/api/cloud_folders_interface.rb +41 -0
- data/lib/mtncloud/api/cloud_policies_interface.rb +41 -0
- data/lib/mtncloud/api/cloud_resource_pools_interface.rb +66 -0
- data/lib/mtncloud/api/clouds_interface.rb +217 -0
- data/lib/mtncloud/api/clusters_interface.rb +471 -0
- data/lib/mtncloud/api/containers_interface.rb +145 -0
- data/lib/mtncloud/api/credential_types_interface.rb +9 -0
- data/lib/mtncloud/api/credentials_interface.rb +9 -0
- data/lib/mtncloud/api/custom_instance_types_interface.rb +99 -0
- data/lib/mtncloud/api/cypher_interface.rb +51 -0
- data/lib/mtncloud/api/dashboard_interface.rb +14 -0
- data/lib/mtncloud/api/datastores_interface.rb +21 -0
- data/lib/mtncloud/api/deploy_interface.rb +44 -0
- data/lib/mtncloud/api/deployments_interface.rb +79 -0
- data/lib/mtncloud/api/distributed_workers_interface.rb +41 -0
- data/lib/mtncloud/api/email_templates_interface.rb +53 -0
- data/lib/mtncloud/api/environments_interface.rb +48 -0
- data/lib/mtncloud/api/execute_schedules_interface.rb +71 -0
- data/lib/mtncloud/api/execution_request_interface.rb +27 -0
- data/lib/mtncloud/api/file_copy_request_interface.rb +68 -0
- data/lib/mtncloud/api/forgot_password_interface.rb +17 -0
- data/lib/mtncloud/api/group_policies_interface.rb +41 -0
- data/lib/mtncloud/api/groups_interface.rb +73 -0
- data/lib/mtncloud/api/guidance_interface.rb +44 -0
- data/lib/mtncloud/api/guidance_settings_interface.rb +17 -0
- data/lib/mtncloud/api/health_interface.rb +100 -0
- data/lib/mtncloud/api/host_vm_groups_interface.rb +37 -0
- data/lib/mtncloud/api/hub_interface.rb +25 -0
- data/lib/mtncloud/api/image_builder_boot_scripts_interface.rb +41 -0
- data/lib/mtncloud/api/image_builder_image_builds_interface.rb +73 -0
- data/lib/mtncloud/api/image_builder_interface.rb +20 -0
- data/lib/mtncloud/api/image_builder_preseed_scripts_interface.rb +41 -0
- data/lib/mtncloud/api/instance_types_interface.rb +20 -0
- data/lib/mtncloud/api/instances_interface.rb +453 -0
- data/lib/mtncloud/api/integration_types_interface.rb +14 -0
- data/lib/mtncloud/api/integrations_interface.rb +74 -0
- data/lib/mtncloud/api/invoice_line_items_interface.rb +9 -0
- data/lib/mtncloud/api/invoices_interface.rb +28 -0
- data/lib/mtncloud/api/jobs_interface.rb +83 -0
- data/lib/mtncloud/api/key_pairs_interface.rb +57 -0
- data/lib/mtncloud/api/library_cluster_layouts_interface.rb +47 -0
- data/lib/mtncloud/api/library_cluster_packages_interface.rb +60 -0
- data/lib/mtncloud/api/library_container_scripts_interface.rb +43 -0
- data/lib/mtncloud/api/library_container_templates_interface.rb +43 -0
- data/lib/mtncloud/api/library_container_types_interface.rb +59 -0
- data/lib/mtncloud/api/library_container_upgrades_interface.rb +60 -0
- data/lib/mtncloud/api/library_instance_types_interface.rb +74 -0
- data/lib/mtncloud/api/library_layouts_interface.rb +69 -0
- data/lib/mtncloud/api/library_operating_systems_interface.rb +63 -0
- data/lib/mtncloud/api/library_spec_template_types_interface.rb +43 -0
- data/lib/mtncloud/api/library_spec_templates_interface.rb +43 -0
- data/lib/mtncloud/api/license_interface.rb +30 -0
- data/lib/mtncloud/api/load_balancer_monitors_interface.rb +9 -0
- data/lib/mtncloud/api/load_balancer_pool_nodes_interface.rb +8 -0
- data/lib/mtncloud/api/load_balancer_pools_interface.rb +9 -0
- data/lib/mtncloud/api/load_balancer_pools_secondary_interface.rb +9 -0
- data/lib/mtncloud/api/load_balancer_profiles_interface.rb +9 -0
- data/lib/mtncloud/api/load_balancer_types_interface.rb +9 -0
- data/lib/mtncloud/api/load_balancer_virtual_servers_interface.rb +18 -0
- data/lib/mtncloud/api/load_balancers_interface.rb +14 -0
- data/lib/mtncloud/api/log_settings_interface.rb +44 -0
- data/lib/mtncloud/api/logs_interface.rb +37 -0
- data/lib/mtncloud/api/migrations_interface.rb +49 -0
- data/lib/mtncloud/api/monitoring_alerts_interface.rb +39 -0
- data/lib/mtncloud/api/monitoring_apps_interface.rb +69 -0
- data/lib/mtncloud/api/monitoring_checks_interface.rb +103 -0
- data/lib/mtncloud/api/monitoring_contacts_interface.rb +41 -0
- data/lib/mtncloud/api/monitoring_groups_interface.rb +77 -0
- data/lib/mtncloud/api/monitoring_incidents_interface.rb +107 -0
- data/lib/mtncloud/api/monitoring_interface.rb +35 -0
- data/lib/mtncloud/api/monitoring_settings_interface.rb +21 -0
- data/lib/mtncloud/api/network_dhcp_relays_interface.rb +36 -0
- data/lib/mtncloud/api/network_dhcp_servers_interface.rb +36 -0
- data/lib/mtncloud/api/network_domain_records_interface.rb +41 -0
- data/lib/mtncloud/api/network_domains_interface.rb +41 -0
- data/lib/mtncloud/api/network_edge_clusters_interface.rb +26 -0
- data/lib/mtncloud/api/network_floating_ips_interface.rb +40 -0
- data/lib/mtncloud/api/network_groups_interface.rb +41 -0
- data/lib/mtncloud/api/network_pool_ips_interface.rb +41 -0
- data/lib/mtncloud/api/network_pool_server_types_interface.rb +9 -0
- data/lib/mtncloud/api/network_pool_servers_interface.rb +48 -0
- data/lib/mtncloud/api/network_pools_interface.rb +41 -0
- data/lib/mtncloud/api/network_proxies_interface.rb +41 -0
- data/lib/mtncloud/api/network_routers_interface.rb +181 -0
- data/lib/mtncloud/api/network_security_server_types_interface.rb +9 -0
- data/lib/mtncloud/api/network_security_servers_interface.rb +27 -0
- data/lib/mtncloud/api/network_server_groups_interface.rb +7 -0
- data/lib/mtncloud/api/network_server_types_interface.rb +9 -0
- data/lib/mtncloud/api/network_servers_interface.rb +102 -0
- data/lib/mtncloud/api/network_services_interface.rb +63 -0
- data/lib/mtncloud/api/network_static_routes_interface.rb +36 -0
- data/lib/mtncloud/api/network_subnets_interface.rb +42 -0
- data/lib/mtncloud/api/network_types_interface.rb +20 -0
- data/lib/mtncloud/api/networks_interface.rb +48 -0
- data/lib/mtncloud/api/option_type_forms_interface.rb +9 -0
- data/lib/mtncloud/api/option_type_lists_interface.rb +53 -0
- data/lib/mtncloud/api/option_types_interface.rb +41 -0
- data/lib/mtncloud/api/options_interface.rb +17 -0
- data/lib/mtncloud/api/packages_interface.rb +112 -0
- data/lib/mtncloud/api/ping_interface.rb +22 -0
- data/lib/mtncloud/api/plugins_interface.rb +22 -0
- data/lib/mtncloud/api/policies_interface.rb +56 -0
- data/lib/mtncloud/api/power_schedules_interface.rb +71 -0
- data/lib/mtncloud/api/price_sets_interface.rb +39 -0
- data/lib/mtncloud/api/prices_interface.rb +71 -0
- data/lib/mtncloud/api/processes_interface.rb +40 -0
- data/lib/mtncloud/api/projects_interface.rb +33 -0
- data/lib/mtncloud/api/provision_types_interface.rb +24 -0
- data/lib/mtncloud/api/provisioning_license_types_interface.rb +31 -0
- data/lib/mtncloud/api/provisioning_licenses_interface.rb +60 -0
- data/lib/mtncloud/api/provisioning_settings_interface.rb +26 -0
- data/lib/mtncloud/api/read_interface.rb +24 -0
- data/lib/mtncloud/api/reports_interface.rb +70 -0
- data/lib/mtncloud/api/resource_pool_groups_interface.rb +51 -0
- data/lib/mtncloud/api/rest_interface.rb +37 -0
- data/lib/mtncloud/api/roles_interface.rb +151 -0
- data/lib/mtncloud/api/scale_thresholds_interface.rb +9 -0
- data/lib/mtncloud/api/search_interface.rb +13 -0
- data/lib/mtncloud/api/secondary_read_interface.rb +25 -0
- data/lib/mtncloud/api/secondary_rest_interface.rb +42 -0
- data/lib/mtncloud/api/security_group_rules_interface.rb +35 -0
- data/lib/mtncloud/api/security_groups_interface.rb +56 -0
- data/lib/mtncloud/api/security_package_types_interface.rb +9 -0
- data/lib/mtncloud/api/security_packages_interface.rb +9 -0
- data/lib/mtncloud/api/security_scans_interface.rb +9 -0
- data/lib/mtncloud/api/server_devices_interface.rb +30 -0
- data/lib/mtncloud/api/server_types_interface.rb +20 -0
- data/lib/mtncloud/api/servers_interface.rb +230 -0
- data/lib/mtncloud/api/service_catalog_interface.rb +89 -0
- data/lib/mtncloud/api/service_plans_interface.rb +62 -0
- data/lib/mtncloud/api/setup_interface.rb +46 -0
- data/lib/mtncloud/api/snapshots_interface.rb +19 -0
- data/lib/mtncloud/api/storage_datastores_interface.rb +44 -0
- data/lib/mtncloud/api/storage_providers_interface.rb +151 -0
- data/lib/mtncloud/api/storage_server_types_interface.rb +14 -0
- data/lib/mtncloud/api/storage_servers_interface.rb +9 -0
- data/lib/mtncloud/api/storage_volume_types_interface.rb +9 -0
- data/lib/mtncloud/api/storage_volumes_interface.rb +24 -0
- data/lib/mtncloud/api/subnet_types_interface.rb +20 -0
- data/lib/mtncloud/api/subnets_interface.rb +41 -0
- data/lib/mtncloud/api/support_bundles_interface.rb +46 -0
- data/lib/mtncloud/api/system_types_interface.rb +13 -0
- data/lib/mtncloud/api/systems_interface.rb +55 -0
- data/lib/mtncloud/api/task_sets_interface.rb +52 -0
- data/lib/mtncloud/api/tasks_interface.rb +66 -0
- data/lib/mtncloud/api/tokens_interface.rb +39 -0
- data/lib/mtncloud/api/usage_interface.rb +18 -0
- data/lib/mtncloud/api/user_groups_interface.rb +59 -0
- data/lib/mtncloud/api/user_settings_interface.rb +90 -0
- data/lib/mtncloud/api/user_sources_interface.rb +99 -0
- data/lib/mtncloud/api/users_interface.rb +33 -0
- data/lib/mtncloud/api/vdi_allocations_interface.rb +9 -0
- data/lib/mtncloud/api/vdi_apps_interface.rb +9 -0
- data/lib/mtncloud/api/vdi_gateways_interface.rb +9 -0
- data/lib/mtncloud/api/vdi_interface.rb +28 -0
- data/lib/mtncloud/api/vdi_pools_interface.rb +19 -0
- data/lib/mtncloud/api/virtual_images_interface.rb +210 -0
- data/lib/mtncloud/api/virtual_servers_interface.rb +9 -0
- data/lib/mtncloud/api/virtual_switches_interface.rb +9 -0
- data/lib/mtncloud/api/whitelabel_settings_interface.rb +57 -0
- data/lib/mtncloud/api/whoami_interface.rb +13 -0
- data/lib/mtncloud/api/wiki_interface.rb +48 -0
- data/lib/mtncloud/api.rb +12 -0
- data/lib/mtncloud/benchmarking.rb +259 -0
- data/lib/mtncloud/cli/cli_command.rb +2281 -0
- data/lib/mtncloud/cli/cli_registry.rb +337 -0
- data/lib/mtncloud/cli/commands/access_token_command.rb +201 -0
- data/lib/mtncloud/cli/commands/account_groups_command.rb +530 -0
- data/lib/mtncloud/cli/commands/activity_command.rb +149 -0
- data/lib/mtncloud/cli/commands/affinity_groups_command.rb +554 -0
- data/lib/mtncloud/cli/commands/alias_command.rb +278 -0
- data/lib/mtncloud/cli/commands/appliance_settings_command.rb +382 -0
- data/lib/mtncloud/cli/commands/approvals_command.rb +236 -0
- data/lib/mtncloud/cli/commands/apps.rb +2549 -0
- data/lib/mtncloud/cli/commands/archives_command.rb +2161 -0
- data/lib/mtncloud/cli/commands/audit.rb +188 -0
- data/lib/mtncloud/cli/commands/backup_jobs_command.rb +366 -0
- data/lib/mtncloud/cli/commands/backup_restores_command.rb +144 -0
- data/lib/mtncloud/cli/commands/backup_results_command.rb +149 -0
- data/lib/mtncloud/cli/commands/backup_services_command.rb +44 -0
- data/lib/mtncloud/cli/commands/backup_settings_command.rb +184 -0
- data/lib/mtncloud/cli/commands/backup_types_command.rb +53 -0
- data/lib/mtncloud/cli/commands/backups_command.rb +674 -0
- data/lib/mtncloud/cli/commands/benchmark_command.rb +458 -0
- data/lib/mtncloud/cli/commands/blueprints_command.rb +2297 -0
- data/lib/mtncloud/cli/commands/boot_scripts_command.rb +379 -0
- data/lib/mtncloud/cli/commands/budgets_command.rb +754 -0
- data/lib/mtncloud/cli/commands/cat_command.rb +45 -0
- data/lib/mtncloud/cli/commands/catalog_item_types_command.rb +858 -0
- data/lib/mtncloud/cli/commands/certificates_command.rb +575 -0
- data/lib/mtncloud/cli/commands/change_password_command.rb +132 -0
- data/lib/mtncloud/cli/commands/clients_command.rb +331 -0
- data/lib/mtncloud/cli/commands/cloud_datastores_command.rb +543 -0
- data/lib/mtncloud/cli/commands/cloud_folders_command.rb +512 -0
- data/lib/mtncloud/cli/commands/cloud_resource_pools_command.rb +870 -0
- data/lib/mtncloud/cli/commands/clouds.rb +2037 -0
- data/lib/mtncloud/cli/commands/clouds_types.rb +140 -0
- data/lib/mtncloud/cli/commands/cluster_types.rb +179 -0
- data/lib/mtncloud/cli/commands/clusters.rb +5855 -0
- data/lib/mtncloud/cli/commands/coloring_command.rb +82 -0
- data/lib/mtncloud/cli/commands/containers_command.rb +967 -0
- data/lib/mtncloud/cli/commands/credential_types_command.rb +36 -0
- data/lib/mtncloud/cli/commands/credentials_command.rb +124 -0
- data/lib/mtncloud/cli/commands/curl_command.rb +168 -0
- data/lib/mtncloud/cli/commands/cypher_command.rb +587 -0
- data/lib/mtncloud/cli/commands/dashboard_command.rb +300 -0
- data/lib/mtncloud/cli/commands/debug_command.rb +75 -0
- data/lib/mtncloud/cli/commands/deploy.rb +485 -0
- data/lib/mtncloud/cli/commands/deployments.rb +923 -0
- data/lib/mtncloud/cli/commands/deploys.rb +485 -0
- data/lib/mtncloud/cli/commands/distributed_workers_command.rb +282 -0
- data/lib/mtncloud/cli/commands/echo_command.rb +61 -0
- data/lib/mtncloud/cli/commands/edit_profile_command.rb +57 -0
- data/lib/mtncloud/cli/commands/edit_rc_command.rb +77 -0
- data/lib/mtncloud/cli/commands/email_templates_command.rb +373 -0
- data/lib/mtncloud/cli/commands/environments_command.rb +401 -0
- data/lib/mtncloud/cli/commands/execute_schedules_command.rb +735 -0
- data/lib/mtncloud/cli/commands/execution_request_command.rb +333 -0
- data/lib/mtncloud/cli/commands/exit_command.rb +34 -0
- data/lib/mtncloud/cli/commands/file_copy_request_command.rb +352 -0
- data/lib/mtncloud/cli/commands/forgot_password.rb +133 -0
- data/lib/mtncloud/cli/commands/get_prompt_command.rb +36 -0
- data/lib/mtncloud/cli/commands/groups.rb +818 -0
- data/lib/mtncloud/cli/commands/guidance_command.rb +529 -0
- data/lib/mtncloud/cli/commands/guidance_settings.rb +148 -0
- data/lib/mtncloud/cli/commands/health_command.rb +1046 -0
- data/lib/mtncloud/cli/commands/history_command.rb +60 -0
- data/lib/mtncloud/cli/commands/host_vm_groups_command.rb +423 -0
- data/lib/mtncloud/cli/commands/hosts.rb +2986 -0
- data/lib/mtncloud/cli/commands/hub.rb +215 -0
- data/lib/mtncloud/cli/commands/image_builder_command.rb +1197 -0
- data/lib/mtncloud/cli/commands/instance_types.rb +163 -0
- data/lib/mtncloud/cli/commands/instances.rb +5813 -0
- data/lib/mtncloud/cli/commands/integrations_command.rb +1412 -0
- data/lib/mtncloud/cli/commands/invoices_command.rb +1151 -0
- data/lib/mtncloud/cli/commands/jobs_command.rb +998 -0
- data/lib/mtncloud/cli/commands/key_pairs.rb +470 -0
- data/lib/mtncloud/cli/commands/library_cluster_layouts_command.rb +901 -0
- data/lib/mtncloud/cli/commands/library_cluster_packages_command.rb +552 -0
- data/lib/mtncloud/cli/commands/library_container_scripts_command.rb +446 -0
- data/lib/mtncloud/cli/commands/library_container_templates_command.rb +526 -0
- data/lib/mtncloud/cli/commands/library_container_types_command.rb +698 -0
- data/lib/mtncloud/cli/commands/library_forms_command.rb +625 -0
- data/lib/mtncloud/cli/commands/library_instance_types_command.rb +668 -0
- data/lib/mtncloud/cli/commands/library_layouts_command.rb +849 -0
- data/lib/mtncloud/cli/commands/library_operating_systems_command.rb +671 -0
- data/lib/mtncloud/cli/commands/library_option_lists_command.rb +503 -0
- data/lib/mtncloud/cli/commands/library_option_types_command.rb +329 -0
- data/lib/mtncloud/cli/commands/library_spec_templates_command.rb +547 -0
- data/lib/mtncloud/cli/commands/library_upgrades_command.rb +596 -0
- data/lib/mtncloud/cli/commands/license.rb +475 -0
- data/lib/mtncloud/cli/commands/load_balancer_monitors.rb +70 -0
- data/lib/mtncloud/cli/commands/load_balancer_pool_nodes.rb +87 -0
- data/lib/mtncloud/cli/commands/load_balancer_pools.rb +129 -0
- data/lib/mtncloud/cli/commands/load_balancer_profiles.rb +64 -0
- data/lib/mtncloud/cli/commands/load_balancer_types.rb +38 -0
- data/lib/mtncloud/cli/commands/load_balancer_virtual_servers.rb +147 -0
- data/lib/mtncloud/cli/commands/load_balancers.rb +189 -0
- data/lib/mtncloud/cli/commands/log_level_command.rb +54 -0
- data/lib/mtncloud/cli/commands/log_settings_command.rb +443 -0
- data/lib/mtncloud/cli/commands/login.rb +148 -0
- data/lib/mtncloud/cli/commands/logout.rb +63 -0
- data/lib/mtncloud/cli/commands/logs_command.rb +140 -0
- data/lib/mtncloud/cli/commands/man_command.rb +409 -0
- data/lib/mtncloud/cli/commands/migrations.rb +453 -0
- data/lib/mtncloud/cli/commands/monitoring_alerts_command.rb +791 -0
- data/lib/mtncloud/cli/commands/monitoring_apps_command.rb +716 -0
- data/lib/mtncloud/cli/commands/monitoring_checks_command.rb +766 -0
- data/lib/mtncloud/cli/commands/monitoring_contacts_command.rb +339 -0
- data/lib/mtncloud/cli/commands/monitoring_groups_command.rb +674 -0
- data/lib/mtncloud/cli/commands/monitoring_incidents_command.rb +835 -0
- data/lib/mtncloud/cli/commands/monitoring_settings.rb +212 -0
- data/lib/mtncloud/cli/commands/network_dhcp_relays_command.rb +375 -0
- data/lib/mtncloud/cli/commands/network_dhcp_servers_command.rb +366 -0
- data/lib/mtncloud/cli/commands/network_domains_command.rb +896 -0
- data/lib/mtncloud/cli/commands/network_edge_clusters_command.rb +288 -0
- data/lib/mtncloud/cli/commands/network_firewalls_command.rb +783 -0
- data/lib/mtncloud/cli/commands/network_floating_ips.rb +147 -0
- data/lib/mtncloud/cli/commands/network_groups_command.rb +654 -0
- data/lib/mtncloud/cli/commands/network_pool_server_types.rb +20 -0
- data/lib/mtncloud/cli/commands/network_pool_servers_command.rb +318 -0
- data/lib/mtncloud/cli/commands/network_pools_command.rb +903 -0
- data/lib/mtncloud/cli/commands/network_proxies_command.rb +578 -0
- data/lib/mtncloud/cli/commands/network_routers_command.rb +2628 -0
- data/lib/mtncloud/cli/commands/network_security_server_types.rb +20 -0
- data/lib/mtncloud/cli/commands/network_server_groups_command.rb +222 -0
- data/lib/mtncloud/cli/commands/network_server_types_command.rb +20 -0
- data/lib/mtncloud/cli/commands/network_servers_command.rb +398 -0
- data/lib/mtncloud/cli/commands/network_services_command.rb +198 -0
- data/lib/mtncloud/cli/commands/network_static_routes_command.rb +451 -0
- data/lib/mtncloud/cli/commands/network_transport_zones_command.rb +412 -0
- data/lib/mtncloud/cli/commands/networks_command.rb +1692 -0
- data/lib/mtncloud/cli/commands/open_command.rb +30 -0
- data/lib/mtncloud/cli/commands/options.rb +231 -0
- data/lib/mtncloud/cli/commands/packages_command.rb +822 -0
- data/lib/mtncloud/cli/commands/ping.rb +242 -0
- data/lib/mtncloud/cli/commands/plugins.rb +214 -0
- data/lib/mtncloud/cli/commands/policies_command.rb +990 -0
- data/lib/mtncloud/cli/commands/power_schedules_command.rb +731 -0
- data/lib/mtncloud/cli/commands/preseed_scripts_command.rb +378 -0
- data/lib/mtncloud/cli/commands/price_sets_command.rb +557 -0
- data/lib/mtncloud/cli/commands/prices_command.rb +692 -0
- data/lib/mtncloud/cli/commands/processes_command.rb +469 -0
- data/lib/mtncloud/cli/commands/projects_command.rb +537 -0
- data/lib/mtncloud/cli/commands/provisioning_licenses_command.rb +509 -0
- data/lib/mtncloud/cli/commands/provisioning_settings_command.rb +238 -0
- data/lib/mtncloud/cli/commands/recent_activity_command.rb +171 -0
- data/lib/mtncloud/cli/commands/remote.rb +1818 -0
- data/lib/mtncloud/cli/commands/reports_command.rb +724 -0
- data/lib/mtncloud/cli/commands/resource_pool_groups_command.rb +586 -0
- data/lib/mtncloud/cli/commands/rm_command.rb +14 -0
- data/lib/mtncloud/cli/commands/roles.rb +3120 -0
- data/lib/mtncloud/cli/commands/scale_thresholds.rb +103 -0
- data/lib/mtncloud/cli/commands/search_command.rb +184 -0
- data/lib/mtncloud/cli/commands/security_group_rules.rb +230 -0
- data/lib/mtncloud/cli/commands/security_groups.rb +1294 -0
- data/lib/mtncloud/cli/commands/security_package_types.rb +32 -0
- data/lib/mtncloud/cli/commands/security_packages.rb +84 -0
- data/lib/mtncloud/cli/commands/security_scans.rb +107 -0
- data/lib/mtncloud/cli/commands/self_service_command.rb +17 -0
- data/lib/mtncloud/cli/commands/server_devices_command.rb +207 -0
- data/lib/mtncloud/cli/commands/service_catalog_command.rb +1528 -0
- data/lib/mtncloud/cli/commands/service_plans_command.rb +895 -0
- data/lib/mtncloud/cli/commands/set_prompt_command.rb +51 -0
- data/lib/mtncloud/cli/commands/setup.rb +423 -0
- data/lib/mtncloud/cli/commands/shell.rb +717 -0
- data/lib/mtncloud/cli/commands/sleep_command.rb +43 -0
- data/lib/mtncloud/cli/commands/snapshots.rb +156 -0
- data/lib/mtncloud/cli/commands/source_command.rb +30 -0
- data/lib/mtncloud/cli/commands/ssl_verification_command.rb +47 -0
- data/lib/mtncloud/cli/commands/storage_datastores.rb +457 -0
- data/lib/mtncloud/cli/commands/storage_providers_command.rb +1401 -0
- data/lib/mtncloud/cli/commands/storage_server_types.rb +45 -0
- data/lib/mtncloud/cli/commands/storage_servers.rb +116 -0
- data/lib/mtncloud/cli/commands/storage_volume_types.rb +45 -0
- data/lib/mtncloud/cli/commands/storage_volumes.rb +236 -0
- data/lib/mtncloud/cli/commands/subnets_command.rb +819 -0
- data/lib/mtncloud/cli/commands/support_bundles_command.rb +606 -0
- data/lib/mtncloud/cli/commands/systems.rb +1203 -0
- data/lib/mtncloud/cli/commands/tasks.rb +1391 -0
- data/lib/mtncloud/cli/commands/tee_command.rb +14 -0
- data/lib/mtncloud/cli/commands/tenants_command.rb +315 -0
- data/lib/mtncloud/cli/commands/tokens_command.rb +391 -0
- data/lib/mtncloud/cli/commands/update_command.rb +46 -0
- data/lib/mtncloud/cli/commands/usage_command.rb +203 -0
- data/lib/mtncloud/cli/commands/user_groups_command.rb +512 -0
- data/lib/mtncloud/cli/commands/user_settings_command.rb +849 -0
- data/lib/mtncloud/cli/commands/user_sources_command.rb +1065 -0
- data/lib/mtncloud/cli/commands/users.rb +897 -0
- data/lib/mtncloud/cli/commands/vdi_allocations_command.rb +159 -0
- data/lib/mtncloud/cli/commands/vdi_apps_command.rb +317 -0
- data/lib/mtncloud/cli/commands/vdi_command.rb +359 -0
- data/lib/mtncloud/cli/commands/vdi_gateways_command.rb +290 -0
- data/lib/mtncloud/cli/commands/vdi_pools_command.rb +574 -0
- data/lib/mtncloud/cli/commands/version_command.rb +38 -0
- data/lib/mtncloud/cli/commands/view.rb +107 -0
- data/lib/mtncloud/cli/commands/virtual_images.rb +1362 -0
- data/lib/mtncloud/cli/commands/virtual_switches_command.rb +336 -0
- data/lib/mtncloud/cli/commands/whitelabel_settings_command.rb +653 -0
- data/lib/mtncloud/cli/commands/whoami.rb +323 -0
- data/lib/mtncloud/cli/commands/wiki_command.rb +448 -0
- data/lib/mtncloud/cli/commands/workflows.rb +1022 -0
- data/lib/mtncloud/cli/credentials.rb +482 -0
- data/lib/mtncloud/cli/dot_file.rb +180 -0
- data/lib/mtncloud/cli/error_handler.rb +307 -0
- data/lib/mtncloud/cli/errors.rb +53 -0
- data/lib/mtncloud/cli/expression_parser.rb +153 -0
- data/lib/mtncloud/cli/mixins/accounts_helper.rb +484 -0
- data/lib/mtncloud/cli/mixins/affinity_helper.rb +118 -0
- data/lib/mtncloud/cli/mixins/backups_helper.rb +200 -0
- data/lib/mtncloud/cli/mixins/deployments_helper.rb +163 -0
- data/lib/mtncloud/cli/mixins/execution_request_helper.rb +50 -0
- data/lib/mtncloud/cli/mixins/infrastructure_helper.rb +966 -0
- data/lib/mtncloud/cli/mixins/jobs_helper.rb +202 -0
- data/lib/mtncloud/cli/mixins/library_helper.rb +539 -0
- data/lib/mtncloud/cli/mixins/load_balancers_helper.rb +176 -0
- data/lib/mtncloud/cli/mixins/logs_helper.rb +131 -0
- data/lib/mtncloud/cli/mixins/monitoring_helper.rb +876 -0
- data/lib/mtncloud/cli/mixins/networks_helper.rb +62 -0
- data/lib/mtncloud/cli/mixins/operations_helper.rb +41 -0
- data/lib/mtncloud/cli/mixins/option_source_helper.rb +254 -0
- data/lib/mtncloud/cli/mixins/print_helper.rb +1631 -0
- data/lib/mtncloud/cli/mixins/processes_helper.rb +286 -0
- data/lib/mtncloud/cli/mixins/prompt_helper.rb +136 -0
- data/lib/mtncloud/cli/mixins/provisioning_helper.rb +2963 -0
- data/lib/mtncloud/cli/mixins/remote_helper.rb +139 -0
- data/lib/mtncloud/cli/mixins/rest_command.rb +994 -0
- data/lib/mtncloud/cli/mixins/secondary_rest_command.rb +700 -0
- data/lib/mtncloud/cli/mixins/storage_servers_helper.rb +93 -0
- data/lib/mtncloud/cli/mixins/storage_volumes_helper.rb +76 -0
- data/lib/mtncloud/cli/mixins/vdi_helper.rb +246 -0
- data/lib/mtncloud/cli/mixins/whoami_helper.rb +73 -0
- data/lib/mtncloud/cli/option_parser.rb +127 -0
- data/lib/mtncloud/cli/option_types.rb +1622 -0
- data/lib/mtncloud/cli/version.rb +6 -0
- data/lib/mtncloud/cli.rb +105 -0
- data/lib/mtncloud/currency.rb +184 -0
- data/lib/mtncloud/ext/hash.rb +109 -0
- data/lib/mtncloud/ext/nil_class.rb +5 -0
- data/lib/mtncloud/ext/rest_client.rb +37 -0
- data/lib/mtncloud/ext/string.rb +66 -0
- data/lib/mtncloud/formatters.rb +511 -0
- data/lib/mtncloud/logging.rb +185 -0
- data/lib/mtncloud/morpkg.rb +119 -0
- data/lib/mtncloud/rest_client.rb +104 -0
- data/lib/mtncloud/routes.rb +304 -0
- data/lib/mtncloud/terminal.rb +528 -0
- data/lib/mtncloud/util.rb +29 -0
- data/lib/mtncloud.rb +5 -0
- data/mtncloud-cli.gemspec +38 -0
- data/test/api/affinity_groups_interface_test.rb +43 -0
- data/test/api/clients_interface_test.rb +23 -0
- data/test/api/clouds_interface_test.rb +67 -0
- data/test/api/containers_interface_test.rb +68 -0
- data/test/api/host_vm_groups_interface_test.rb +35 -0
- data/test/api/instances_interface_test.rb +22 -0
- data/test/api/network_routers_interface_test.rb +22 -0
- data/test/api/systems_interface_test.rb +26 -0
- data/test/api/whoami_interface_test.rb +14 -0
- data/test/branding_test.rb +160 -0
- data/test/cli/access_token_test.rb +36 -0
- data/test/cli/affinity_groups_cloud_cluster_scope_test.rb +270 -0
- data/test/cli/affinity_groups_cluster_scope_test.rb +171 -0
- data/test/cli/affinity_groups_test.rb +57 -0
- data/test/cli/affinity_groups_violations_scope_test.rb +141 -0
- data/test/cli/affinity_helper_test.rb +367 -0
- data/test/cli/auth_test.rb +88 -0
- data/test/cli/backups_test.rb +212 -0
- data/test/cli/cli_test.rb +48 -0
- data/test/cli/clients_test.rb +45 -0
- data/test/cli/clusters_uuid_test.rb +146 -0
- data/test/cli/containers_test.rb +92 -0
- data/test/cli/distributed_workers_test.rb +68 -0
- data/test/cli/help_test.rb +25 -0
- data/test/cli/host_vm_groups_cluster_scope_test.rb +187 -0
- data/test/cli/host_vm_groups_test.rb +63 -0
- data/test/cli/infrastructure_helper_cluster_resolver_test.rb +250 -0
- data/test/cli/instances_test.rb +37 -0
- data/test/cli/man_test.rb +14 -0
- data/test/cli/migrations_test.rb +39 -0
- data/test/cli/network_routers_test.rb +65 -0
- data/test/cli/remote_test.rb +89 -0
- data/test/cli/roles_test.rb +47 -0
- data/test/cli/shell_test.rb +81 -0
- data/test/cli/storage_volumes_test.rb +79 -0
- data/test/cli/systems_test.rb +206 -0
- data/test/cli/version_test.rb +23 -0
- data/test/cli/view_test.rb +55 -0
- data/test/cli/whoami_test.rb +17 -0
- data/test/mtncloud_test.rb +16 -0
- data/test/test_case.rb +342 -0
- data/test/test_config.rb +137 -0
- data/test/test_data_helper.rb +97 -0
- metadata +807 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 639203a2d4abce5fa9f74f710a71dd159f38c775dcd009549aba64fe5de773c9
|
|
4
|
+
data.tar.gz: d598611f41e31e3546003dd12db8e84be2c4cc5e1a440bb8fb51b78d5f21dc23
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e2b6e6aea6578305035081434b24ce671a43df0ccd0760bf2813a7dbea54c932382d37f002f1ad32ede689bd9f34c956f04d6126b9cb78625b48cfca468a2971
|
|
7
|
+
data.tar.gz: 0aec3580475e9814d229695f76d89f3f254a7111831367b4f26fb049c695b441e708049a951da5d2938e193359ba30912c9cf9c208e5cd84a6e09fe3a280f9f0
|
data/.dockerignore
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Keep local and generated files out of the Docker build context.
|
|
2
|
+
# Do NOT add .git here: the gem build uses `git ls-files` to list its files.
|
|
3
|
+
# Only exclude files that are not tracked by git, or the gem build will fail.
|
|
4
|
+
|
|
5
|
+
# test credentials for the live appliance tests
|
|
6
|
+
test_config.yaml
|
|
7
|
+
|
|
8
|
+
# built gems and bundler state
|
|
9
|
+
*.gem
|
|
10
|
+
pkg
|
|
11
|
+
.bundle
|
|
12
|
+
Gemfile.lock
|
|
13
|
+
|
|
14
|
+
# temporary and editor files
|
|
15
|
+
tmp
|
|
16
|
+
coverage
|
|
17
|
+
*.log
|
|
18
|
+
.idea
|
|
19
|
+
.vscode
|
|
20
|
+
.DS_Store
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## What this changes
|
|
2
|
+
|
|
3
|
+
<!-- What does this pull request change, and why? -->
|
|
4
|
+
|
|
5
|
+
## How it was tested
|
|
6
|
+
|
|
7
|
+
<!-- For example: bundle exec rake test:offline, or commands you ran against an appliance -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] `bundle exec rake test:offline` passes
|
|
12
|
+
- [ ] Tests added or updated for the changed behaviour
|
|
13
|
+
- [ ] README updated if installation, configuration or usage changed
|
|
14
|
+
- [ ] Customer-facing text says MTN Cloud, not Morpheus
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Runs on every pull request and every push to main.
|
|
2
|
+
# main is protected: a pull request can only be merged when every job here passes.
|
|
3
|
+
name: CI
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: Offline tests (Ruby ${{ matrix.ruby }})
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
ruby: ["3.3", "3.4", "4.0"]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v5
|
|
23
|
+
|
|
24
|
+
- uses: ruby/setup-ruby@v1
|
|
25
|
+
with:
|
|
26
|
+
ruby-version: ${{ matrix.ruby }}
|
|
27
|
+
bundler-cache: true
|
|
28
|
+
|
|
29
|
+
- name: Run offline tests
|
|
30
|
+
run: bundle exec rake test:offline
|
|
31
|
+
|
|
32
|
+
build:
|
|
33
|
+
name: Build gem
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v5
|
|
37
|
+
|
|
38
|
+
- uses: ruby/setup-ruby@v1
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: "3.3"
|
|
41
|
+
|
|
42
|
+
- name: Build the gem
|
|
43
|
+
run: gem build mtncloud-cli.gemspec
|
|
44
|
+
|
|
45
|
+
# One check for branch protection to require, so the protection rule does not
|
|
46
|
+
# need to change when the Ruby versions above change.
|
|
47
|
+
ci-passed:
|
|
48
|
+
name: CI passed
|
|
49
|
+
if: always()
|
|
50
|
+
needs: [test, build]
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
steps:
|
|
53
|
+
- name: Fail unless every job passed
|
|
54
|
+
run: |
|
|
55
|
+
echo "test: ${{ needs.test.result }}, build: ${{ needs.build.result }}"
|
|
56
|
+
[ "${{ needs.test.result }}" = "success" ] && [ "${{ needs.build.result }}" = "success" ]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Publishes the mtncloud-cli gem to RubyGems.org when a version tag is pushed.
|
|
2
|
+
#
|
|
3
|
+
# Release a new version:
|
|
4
|
+
# 1. Bump VERSION in lib/mtncloud/cli/version.rb and push to main.
|
|
5
|
+
# 2. git tag v<version> && git push origin v<version>
|
|
6
|
+
#
|
|
7
|
+
# Uses RubyGems trusted publishing, so no API key is stored in this repository.
|
|
8
|
+
# RubyGems.org must list this repository, this workflow file (release.yml)
|
|
9
|
+
# and the "release" environment as a trusted publisher. See README > Releasing.
|
|
10
|
+
name: Publish gem
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
push:
|
|
14
|
+
tags:
|
|
15
|
+
- "v*"
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
push:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
|
|
21
|
+
permissions:
|
|
22
|
+
contents: write
|
|
23
|
+
id-token: write
|
|
24
|
+
|
|
25
|
+
environment: release
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v5
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- name: Set up Ruby
|
|
33
|
+
uses: ruby/setup-ruby@v1
|
|
34
|
+
with:
|
|
35
|
+
bundler-cache: true
|
|
36
|
+
ruby-version: "3.3"
|
|
37
|
+
|
|
38
|
+
- name: Check the tag matches the gem version
|
|
39
|
+
run: |
|
|
40
|
+
gem_version=$(ruby -Ilib -e 'require "mtncloud/cli/version"; print MtnCloud::Cli::VERSION')
|
|
41
|
+
if [ "${GITHUB_REF_NAME}" != "v${gem_version}" ]; then
|
|
42
|
+
echo "::error::Tag ${GITHUB_REF_NAME} does not match the gem version ${gem_version} in lib/mtncloud/cli/version.rb"
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
- uses: rubygems/release-gem@v1
|
data/.gitignore
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
.bundle
|
|
4
|
+
.config
|
|
5
|
+
.yardoc
|
|
6
|
+
Gemfile.lock
|
|
7
|
+
InstalledFiles
|
|
8
|
+
_yardoc
|
|
9
|
+
coverage
|
|
10
|
+
doc/
|
|
11
|
+
lib/bundler/man
|
|
12
|
+
pkg
|
|
13
|
+
rdoc
|
|
14
|
+
spec/reports
|
|
15
|
+
test/tmp
|
|
16
|
+
test/version_tmp
|
|
17
|
+
tmp
|
|
18
|
+
*.bundle
|
|
19
|
+
*.so
|
|
20
|
+
*.o
|
|
21
|
+
*.a
|
|
22
|
+
mkmf.log
|
|
23
|
+
.DS_Store
|
|
24
|
+
.idea
|
|
25
|
+
test_config.yaml
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# MTN Cloud CLI
|
|
2
|
+
|
|
3
|
+
Ruby gem `mtncloud-cli`. It installs the `mtncloud` command and its alias `mcs`. Code is under `lib/mtncloud/` in the `MtnCloud::` namespace. See CONTRIBUTING.md and the README.
|
|
4
|
+
|
|
5
|
+
## Git workflow (required)
|
|
6
|
+
|
|
7
|
+
- Never commit or push to `main`. It is protected, and direct pushes are rejected.
|
|
8
|
+
- For every code or docs change: create a branch from an up-to-date `main` (`feature/`, `fix/`, `docs/` or `chore/` prefix), commit there, push the branch, and open a pull request against `main` with `gh pr create --base main`.
|
|
9
|
+
- Merge only after the **CI passed** check succeeds (`gh pr checks <number> --watch`). Never bypass a failing or pending check.
|
|
10
|
+
- Never force-push to `main` and never delete it.
|
|
11
|
+
|
|
12
|
+
## Testing
|
|
13
|
+
|
|
14
|
+
- Run `bundle exec rake test:offline` before opening a pull request. CI runs the same task on Ruby 3.3, 3.4 and 4.0.
|
|
15
|
+
- Tests that `require 'mtncloud_test'` need a live appliance and are not run by CI.
|
|
16
|
+
|
|
17
|
+
## Naming
|
|
18
|
+
|
|
19
|
+
- Customer-facing text says MTN Cloud, and commands are shown as `mtncloud`.
|
|
20
|
+
- Keep values the appliance or its API defines unchanged, even though they contain "Morpheus": the `X-Morpheus-Lease` and `X-Morpheus-Token` headers, `MORPHEUS_LEASE_TOKEN`, the `morpheus.yml` fallback, job type codes such as `morpheus.task`, the `morpheus` blueprint and backup provider codes, and Morpheus Hub. `test/branding_test.rb` lists the approved ones.
|
|
21
|
+
|
|
22
|
+
## Releases
|
|
23
|
+
|
|
24
|
+
Pushing a `v<version>` tag runs `.github/workflows/release.yml`, which publishes to RubyGems. The tag must match `VERSION` in `lib/mtncloud/cli/version.rb`. Push a release tag only when the user asks for one.
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Contributing to the MTN Cloud CLI
|
|
2
|
+
|
|
3
|
+
Thank you for helping improve the MTN Cloud CLI. This guide explains how changes get into the project.
|
|
4
|
+
|
|
5
|
+
## How changes reach main
|
|
6
|
+
|
|
7
|
+
`main` is protected. Nobody pushes to it directly, including maintainers. Every change goes through a pull request:
|
|
8
|
+
|
|
9
|
+
1. Update your local `main`:
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
git checkout main
|
|
13
|
+
git pull
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
2. Create a branch for your change:
|
|
17
|
+
|
|
18
|
+
```shell
|
|
19
|
+
git checkout -b fix/clusters-get-help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Name the branch after the change, with a prefix: `feature/`, `fix/`, `docs/` or `chore/`.
|
|
23
|
+
|
|
24
|
+
3. Make your change, run the offline tests (see [Testing](#testing)), and commit.
|
|
25
|
+
4. Push the branch and open a pull request against `main`:
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
git push -u origin fix/clusters-get-help
|
|
29
|
+
gh pr create --base main
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
5. Wait for the **CI passed** check. It runs the offline tests on Ruby 3.3, 3.4 and 4.0 and builds the gem.
|
|
33
|
+
6. When CI passes, merge the pull request. A pull request cannot be merged while CI is failing or still running.
|
|
34
|
+
|
|
35
|
+
If CI fails, push more commits to the same branch. CI runs again on every push.
|
|
36
|
+
|
|
37
|
+
## Setting up
|
|
38
|
+
|
|
39
|
+
Requirements:
|
|
40
|
+
|
|
41
|
+
- Ruby 3.3 or newer
|
|
42
|
+
- Bundler 2
|
|
43
|
+
- Git
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
git clone https://github.com/Jose-henry/mtncloud-cli
|
|
47
|
+
cd mtncloud-cli
|
|
48
|
+
bundle install
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Run the CLI from your working copy:
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
bundle exec ruby bin/mtncloud --help
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
See [Development](README.md#development) in the README for the code layout.
|
|
58
|
+
|
|
59
|
+
## Testing
|
|
60
|
+
|
|
61
|
+
Run the offline tests before you open a pull request. They don't need an MTN Cloud appliance, and they are the same tests CI runs:
|
|
62
|
+
|
|
63
|
+
```shell
|
|
64
|
+
bundle exec rake test:offline
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Add or update tests for the behaviour you change. A test that doesn't need an appliance must not `require 'mtncloud_test'`, so that `test:offline` and CI run it.
|
|
68
|
+
|
|
69
|
+
`test/branding_test.rb` fails if any command's help mentions Morpheus, except for values that belong to the appliance, such as the `X-Morpheus-Lease` header. Keep it passing.
|
|
70
|
+
|
|
71
|
+
The tests that need a live appliance are described in [Testing](README.md#testing) in the README. Run them when you change how the CLI talks to the API.
|
|
72
|
+
|
|
73
|
+
## Writing changes
|
|
74
|
+
|
|
75
|
+
- Keep each pull request to one change. Separate refactoring from behaviour changes.
|
|
76
|
+
- Follow the style of the code around your change.
|
|
77
|
+
- Customer-facing text says **MTN Cloud**, and commands are shown as `mtncloud`. Values that the appliance or its API defines keep their names, for example `X-Morpheus-Lease` and `MORPHEUS_LEASE_TOKEN`.
|
|
78
|
+
- Update the README when you change how the CLI is installed, configured or used.
|
|
79
|
+
|
|
80
|
+
## Commit messages
|
|
81
|
+
|
|
82
|
+
- Write a short summary line in the imperative mood, for example "Fix clusters get usage on Ruby 3.4".
|
|
83
|
+
- If the reason for the change isn't obvious, explain it in the body.
|
|
84
|
+
|
|
85
|
+
## Releases
|
|
86
|
+
|
|
87
|
+
Maintainers publish releases. See [Releasing](README.md#releasing) in the README. The version bump goes through a pull request like any other change, and the version tag is pushed after that pull request is merged.
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
By contributing, you agree that your contributions are licensed under the project's [MIT license](LICENSE.txt).
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Stage 1: build the mtncloud-cli gem from this repository.
|
|
2
|
+
# The gemspec lists its files with `git ls-files`, so this stage needs the .git
|
|
3
|
+
# directory in the build context. Only files tracked by git go into the gem.
|
|
4
|
+
FROM ruby:3.3 AS build
|
|
5
|
+
WORKDIR /src
|
|
6
|
+
COPY . .
|
|
7
|
+
RUN gem build mtncloud-cli.gemspec -o /mtncloud-cli.gem
|
|
8
|
+
|
|
9
|
+
# Stage 2: install the gem into a clean image.
|
|
10
|
+
# Only the built .gem is copied from stage 1, so nothing else from the build
|
|
11
|
+
# context (local files such as test_config.yaml, or the .git directory)
|
|
12
|
+
# ends up in the final image.
|
|
13
|
+
FROM ruby:3.3
|
|
14
|
+
COPY --from=build /mtncloud-cli.gem /tmp/mtncloud-cli.gem
|
|
15
|
+
RUN gem install /tmp/mtncloud-cli.gem --no-document \
|
|
16
|
+
&& rm /tmp/mtncloud-cli.gem
|
|
17
|
+
|
|
18
|
+
WORKDIR /root
|
|
19
|
+
ENTRYPOINT ["mtncloud"]
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Copyright (c) 2026 MTN Cloud
|
|
2
|
+
Copyright (c) 2015 David Estes
|
|
3
|
+
|
|
4
|
+
MIT License
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
+
a copy of this software and associated documentation files (the
|
|
8
|
+
"Software"), to deal in the Software without restriction, including
|
|
9
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
10
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
11
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
12
|
+
the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be
|
|
15
|
+
included in all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
21
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
22
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
23
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# MTN Cloud CLI
|
|
2
|
+
|
|
3
|
+
The MTN Cloud CLI is a command line interface for managing MTN Cloud. You can use it to provision and manage instances, hosts and clusters, deploy applications, run tasks and workflows, and automate most of what you can do in the MTN Cloud UI.
|
|
4
|
+
|
|
5
|
+
It installs two commands that run the same CLI:
|
|
6
|
+
|
|
7
|
+
- `mtncloud`
|
|
8
|
+
- `mcs`, a short alias for `mtncloud`
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
Requirements:
|
|
13
|
+
|
|
14
|
+
- Ruby. The CLI is tested on Ruby 3.3. On Windows, install Ruby+Devkit from [rubyinstaller.org](https://rubyinstaller.org/downloads/) and select the option to add Ruby to your PATH.
|
|
15
|
+
|
|
16
|
+
Install the CLI from RubyGems:
|
|
17
|
+
|
|
18
|
+
```shell
|
|
19
|
+
gem install mtncloud-cli --no-document
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Check the installation:
|
|
23
|
+
|
|
24
|
+
```shell
|
|
25
|
+
mtncloud version
|
|
26
|
+
mcs version
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
On Windows, a first install from a clean environment took about 17 minutes in our testing, mostly spent compiling native extensions for dependencies such as `ffi`, `llhttp-ffi` and `bigdecimal`. Your install time may differ.
|
|
30
|
+
|
|
31
|
+
### Updating
|
|
32
|
+
|
|
33
|
+
```shell
|
|
34
|
+
gem update mtncloud-cli
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Installing from source
|
|
38
|
+
|
|
39
|
+
To install an unreleased version, build the gem from a clone of this repository. The build needs Git, which it uses to list the files to package.
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
git clone https://github.com/Jose-henry/mtncloud-cli
|
|
43
|
+
cd mtncloud-cli
|
|
44
|
+
gem build mtncloud-cli.gemspec -o mtncloud-cli.gem
|
|
45
|
+
gem install ./mtncloud-cli.gem
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Docker
|
|
49
|
+
|
|
50
|
+
The Dockerfile builds the CLI from this repository. Build it from the root of a git clone, because the gem build needs the `.git` directory.
|
|
51
|
+
|
|
52
|
+
```shell
|
|
53
|
+
docker build -t mtncloud-cli .
|
|
54
|
+
docker run --rm -it -v ~/.mtncloud:/root/.mtncloud mtncloud-cli remote list
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The volume keeps your remotes and credentials between runs.
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
Add your MTN Cloud remote, then log in:
|
|
62
|
+
|
|
63
|
+
```shell
|
|
64
|
+
mtncloud remote add mtncloud https://console.cloud.mtn.ng
|
|
65
|
+
mtncloud login
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then run commands, for example:
|
|
69
|
+
|
|
70
|
+
```shell
|
|
71
|
+
mtncloud instances list
|
|
72
|
+
mcs instances list
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Help is available for every command and subcommand with `-h`:
|
|
76
|
+
|
|
77
|
+
```shell
|
|
78
|
+
mtncloud --help
|
|
79
|
+
mcs instances list --help
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`mtncloud shell` starts an interactive shell. `mtncloud man` opens the full manual, which includes the help for every command.
|
|
83
|
+
|
|
84
|
+
## Configuration
|
|
85
|
+
|
|
86
|
+
The CLI keeps its configuration in `~/.mtncloud`. Set `MTNCLOUD_CLI_HOME` to use a different directory, for example to keep separate configurations:
|
|
87
|
+
|
|
88
|
+
```shell
|
|
89
|
+
MTNCLOUD_CLI_HOME=~/.mtncloud_test mtncloud remote list
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Files in the home directory include:
|
|
93
|
+
|
|
94
|
+
| File | Contents |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `appliances` | Your remotes, keyed by name |
|
|
97
|
+
| `credentials` | Access tokens for each remote |
|
|
98
|
+
| `groups` | The active group for each remote |
|
|
99
|
+
| `.mtncloud_profile` | Commands run every time the CLI starts |
|
|
100
|
+
| `.mtncloudrc` | Commands run when `mtncloud shell` starts |
|
|
101
|
+
| `shell_history` | History for `mtncloud shell` |
|
|
102
|
+
|
|
103
|
+
The `appliances` and `credentials` files are saved with file permissions `0600`. Only one system user should use a home directory.
|
|
104
|
+
|
|
105
|
+
Other environment variables:
|
|
106
|
+
|
|
107
|
+
| Variable | Purpose |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `MTNCLOUD_PS1` | The prompt for `mtncloud shell`. See `mtncloud set-prompt --help`. |
|
|
110
|
+
| `MTNCLOUD_CLI_TMPDIR` | Where temporary shells (`mtncloud shell -Z`) are created. The default is the `tmp` directory inside the home directory. |
|
|
111
|
+
|
|
112
|
+
## Development
|
|
113
|
+
|
|
114
|
+
Install the dependencies with Bundler 2.2 or newer:
|
|
115
|
+
|
|
116
|
+
```shell
|
|
117
|
+
bundle install
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Run the CLI from your working copy:
|
|
121
|
+
|
|
122
|
+
```shell
|
|
123
|
+
bundle exec ruby bin/mtncloud --help
|
|
124
|
+
bundle exec ruby bin/mcs --help
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
To reload your code changes without restarting, start a shell and use `reload`:
|
|
128
|
+
|
|
129
|
+
```shell
|
|
130
|
+
bundle exec ruby bin/mtncloud shell --debug
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Code layout:
|
|
134
|
+
|
|
135
|
+
- API interfaces are in `lib/mtncloud/api/`.
|
|
136
|
+
- CLI commands are in `lib/mtncloud/cli/commands/`.
|
|
137
|
+
|
|
138
|
+
### Testing
|
|
139
|
+
|
|
140
|
+
Offline tests don't need an appliance. CI runs them on every pull request:
|
|
141
|
+
|
|
142
|
+
```shell
|
|
143
|
+
bundle exec rake test:offline
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
They include:
|
|
147
|
+
|
|
148
|
+
- `test/branding_test.rb`, which checks every command's help for leftover non-MTN Cloud branding
|
|
149
|
+
- the test files under `test/cli/` and `test/api/` that do not `require 'mtncloud_test'`
|
|
150
|
+
|
|
151
|
+
The other tests run against a live appliance. Create a `test_config.yaml` in the repository root:
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
url: 'https://console.cloud.mtn.ng'
|
|
155
|
+
username: (accountID/Subdomain)\testrunner
|
|
156
|
+
password: 'SecretPassword123$'
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Then run all the tests:
|
|
160
|
+
|
|
161
|
+
```shell
|
|
162
|
+
bundle exec rake test
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Contributing
|
|
166
|
+
|
|
167
|
+
Changes reach `main` only through pull requests that pass CI. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
168
|
+
|
|
169
|
+
## Releasing
|
|
170
|
+
|
|
171
|
+
New versions are published to RubyGems by the [Publish gem](.github/workflows/release.yml) workflow when a version tag is pushed:
|
|
172
|
+
|
|
173
|
+
1. Update `VERSION` in `lib/mtncloud/cli/version.rb` in a pull request, and merge it once CI passes.
|
|
174
|
+
2. Tag the merged commit on `main` and push the tag:
|
|
175
|
+
|
|
176
|
+
```shell
|
|
177
|
+
git tag v1.0.1
|
|
178
|
+
git push origin v1.0.1
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The workflow fails if the tag does not match `VERSION`. RubyGems does not accept the same version twice.
|
|
182
|
+
|
|
183
|
+
The workflow uses RubyGems trusted publishing, so no API key is stored in this repository. On RubyGems.org, the trusted publisher for `mtncloud-cli` names this repository, the `release.yml` workflow and the `release` environment. If the repository moves, update the repository owner and name in that trusted publisher.
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
MIT. See [LICENSE.txt](LICENSE.txt).
|
data/Rakefile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
2
|
+
require "rake/testtask"
|
|
3
|
+
|
|
4
|
+
# Every test, including the ones that need a live appliance (see README > Testing).
|
|
5
|
+
Rake::TestTask.new(:test) do |t|
|
|
6
|
+
t.libs << "test"
|
|
7
|
+
t.libs << "lib"
|
|
8
|
+
t.test_files = FileList['test/**/*_test.rb']
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Tests that need a live appliance load the mtncloud_test helper.
|
|
12
|
+
OFFLINE_TESTS = FileList['test/**/*_test.rb'].exclude('test/mtncloud_test.rb').reject do |f|
|
|
13
|
+
File.read(f).include?("require 'mtncloud_test'")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
desc "Run the tests that do not need a live appliance, one file at a time"
|
|
17
|
+
task "test:offline" do
|
|
18
|
+
failed = OFFLINE_TESTS.reject do |f|
|
|
19
|
+
puts "== #{f}"
|
|
20
|
+
ruby("-Ilib", "-Itest", f) { |ok, _status| ok }
|
|
21
|
+
end
|
|
22
|
+
abort "Failed: #{failed.join(', ')}" unless failed.empty?
|
|
23
|
+
puts "All #{OFFLINE_TESTS.size} offline test files passed."
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
#task :default => :test
|
data/bin/mcs
ADDED
data/bin/mtncloud
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'mtncloud'
|
|
3
|
+
|
|
4
|
+
# arguments
|
|
5
|
+
args = ARGV.dup
|
|
6
|
+
|
|
7
|
+
# input pipe: only read stdin as arguments when --stdin is explicitly passed.
|
|
8
|
+
# Previously stdin was always consumed when not a TTY, which caused the CLI
|
|
9
|
+
# invoked inside a piped bash script (e.g. base64 -d <<< <script> | bash -l)
|
|
10
|
+
# to consume the remaining script lines as CLI arguments (MORPH-6237).
|
|
11
|
+
# Usage: echo 42 | mtncloud instances get --stdin
|
|
12
|
+
if args.delete('--stdin') && !$stdin.tty?
|
|
13
|
+
pipe_data = $stdin.read
|
|
14
|
+
if pipe_data
|
|
15
|
+
args += pipe_data.split
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# output pipe
|
|
20
|
+
# if !$stdout.tty?
|
|
21
|
+
|
|
22
|
+
# end
|
|
23
|
+
|
|
24
|
+
terminal = MtnCloud::Terminal.new
|
|
25
|
+
exit_code, err = terminal.execute(args)
|
|
26
|
+
# raise err unless err.nil?
|
|
27
|
+
exit exit_code
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'mtncloud/api/api_client'
|
|
2
|
+
|
|
3
|
+
class MtnCloud::AccountGroupsInterface < MtnCloud::APIClient
|
|
4
|
+
|
|
5
|
+
def get(account_id, id, params={})
|
|
6
|
+
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
|
7
|
+
url = "#{@base_url}/api/accounts/#{account_id}/groups/#{id}"
|
|
8
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
|
9
|
+
opts = {method: :get, url: url, headers: headers}
|
|
10
|
+
execute(opts)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def list(account_id, params={})
|
|
14
|
+
url = "#{@base_url}/api/accounts/#{account_id}/groups"
|
|
15
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
|
16
|
+
opts = {method: :get, url: url, headers: headers}
|
|
17
|
+
execute(opts)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def create(account_id, payload)
|
|
21
|
+
url = "#{@base_url}/api/accounts/#{account_id}/groups"
|
|
22
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
|
23
|
+
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
|
24
|
+
execute(opts)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def update(account_id, id, payload)
|
|
28
|
+
url = "#{@base_url}/api/accounts/#{account_id}/groups/#{id}"
|
|
29
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
|
30
|
+
opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
|
|
31
|
+
execute(opts)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def destroy(account_id, id, params={})
|
|
35
|
+
url = "#{@base_url}/api/accounts/#{account_id}/groups/#{id}"
|
|
36
|
+
headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
|
37
|
+
opts = {method: :delete, url: url, headers: headers}
|
|
38
|
+
execute(opts)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def update_zones(account_id, id, payload)
|
|
42
|
+
url = "#{@base_url}/api/accounts/#{account_id}/groups/#{id}/update-zones"
|
|
43
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
|
44
|
+
opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
|
|
45
|
+
execute(opts)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|