CLI Commands Using cfa-cloudops¶
The cfa-cloudops package provides a set of command-line interface (CLI) commands for managing Cloud resources and workflows. These commands allow users to interact with the Cloud from the terminal, providing flexibility to any programming language rather than restricting users to python. It is built on top of the cfa.cloudops.CloudClient class for its authentication and methods.
Getting Started¶
The CLI commands are available as long as the cfa-cloudops package is installed in your development environment. This can be done by running the following in your terminal:
Available Commands¶
The following commands are available via the command line:
- create_pool
- create_job
- add_task
- create_blob_container
- upload_file
- upload_folder
- monitor_job
- check_job_status
- delete_job
- package_and_upload_dockerfile
- upload_docker_image
- download_file
- download_folder
- delete_pool
- list_blob_files
- delete_blob_file
- delete_blob_folder
- download_job_stats
- download_after_job
- add_tasks_from_yaml
- generate_sample_env
Use¶
Because the CLI commands are built using the CloudClient class, all commands will take in --dotenv_path, --use_sp, and --use_federated as optional arguments. Other arguments change depending on the command. These arguments can be described by including a -h flag after the desired command, like below.
You may need a .env file depending on what commands you hope to run. A sample .env file can be generated by running the following in your terminal. This creates a file you can edit and rename for your use.
Real Life Use Case¶
Suppose we want to create a job, run a task, then delete the job, all through the command line. This can be done by running the three following commands in the terminal.