Skip to content

ysoftdevs/otc-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTC CLI

A command-line interface (CLI) tool for Open Telekom Cloud (OTC) services.

Features

  • 🔐 Authentication: Browser-based SSO login with credential management
  • ☁️ Multi-cloud Support: Manage multiple cloud configurations via clouds.yaml
  • 🖥️ ECS Management: List and manage Elastic Cloud Servers
  • 🐳 CCE Operations: List clusters and manage CCE (Cloud Container Engine) configurations
  • 🌍 Multi-region: Support for different regions and projects

Installation

From Source

git clone https://github.com/ysoftdevs/otc-cli.git
cd otc-cli
go build -o otc .

Pre-built Binaries

Download the latest release for your platform from the Releases page.

Configuration

clouds.yaml

Create a clouds.yaml file in your home directory (~/.config/openstack/clouds.yaml):

clouds:
  my-cloud:
    region: eu-de
    auth:
      auth_url: https://iam.eu-de.otc.t-systems.com/v3
      domain_id: your-domain-id
    sso:
      protocol: saml
      idp: your-idp
      base_url: https://auth.otc.t-systems.com/authui/federation/websso
      expiration: 3600

Environment Variables

You can override configuration using environment variables with the OTC_ prefix:

  • OTC_CLOUD: Cloud name from clouds.yaml
  • OTC_REGION: Region to use
  • OTC_PROJECT: Project name

Usage

Authentication

Login using browser-based SSO:

otc login

With specific cloud configuration:

otc login --cloud my-cloud --domain-id YOUR_DOMAIN_ID

Custom authentication parameters:

otc login \
  --url https://auth.otc.t-systems.com/authui/federation/websso \
  --auth-url https://iam.eu-de.otc.t-systems.com/v3 \
  --domain-id YOUR_DOMAIN_ID \
  --idp YOUR_IDP \
  --protocol saml \
  --expiration 3600

ECS (Elastic Cloud Server)

List ECS instances from cloud and region specified in config files:

otc ecs list

With specific cloud and region:

otc ecs list --cloud my-cloud --region eu-de

CCE (Cloud Container Engine)

List CCE clusters:

otc cce list

Get kubeconfig for a cluster:

otc cce config CLUSTER_NAME

Save kubeconfig to file:

otc cce config CLUSTER_NAME --output kubeconfig.yaml

Global Flags

These flags are available for all commands:

  • -c, --cloud: Name of the cloud from clouds.yaml to use
  • -r, --region: Region to use for the cloud
  • -p, --project: Project name to use for authentication

Development

Prerequisites

  • Go 1.21 or higher

Building

go build -v ./...

Running Tests

go test -v ./...

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

CLI for OpenTelecom Cloud

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages