Closed
Description
Add create command to jobs CLI
Description
Currently, the CLI's jobs
command only supports list
and get
operations. We need to add support for creating jobs using a JSON configuration file, similar to how the infrastructure creation works.
Current Behavior
- The CLI only supports
jobs list
andjobs get
commands - Attempting to use
jobs create -f create_job.json
results in an error
Proposed Behavior
Add a new subcommand create
to the jobs command that:
- Accepts a JSON file through the
-f
or--file
flag - Validates the JSON input against the job schema
- Creates a new job through the API client
- Returns the created job information
Technical Details
CLI Command Structure
talis-cli jobs create [-f|--file] <json-file>
Required Changes
- Add new
createJobCmd
incmd/cli/commands/jobs.go
- Add JSON schema validation for job creation
- Implement job creation through the API client
- Add proper error handling and user feedback
Example JSON Schema
{
"name": "talis-cli",
"project_name": "talis-1",
"job_name": "talis-cli",
"owner_id": 1,
"instances": [
{
"name": "test-hostname",
"provider": "do",
"number_of_instances": 1,
"provision": true,
"region": "nyc1",
"size": "s-1vcpu-1gb",
"image": "ubuntu-22-04-x64",
"tags": ["talis", "dev", "testing"],
"ssh_key_name": "<ssh-key-name>",
"volumes": [
{
"name": "talis-volume",
"size_gb": 15,
"mount_point": "/mnt/data"
}
]
}
]
}
Acceptance Criteria
- New
create
subcommand is added to the jobs commandCommand accepts a JSON file through the-f
or--file
flagJSON input is properly validatedJob is created through the API clientAppropriate success/error messages are displayedDocumentation is updated to include the new commandTests are added for the new functionality
Related
- Follows the same pattern as infrastructure creation command
- Should integrate with existing job management API endpoints
Labels
- enhancement
- cli
- jobs
Activity
MSevey commentedon Apr 15, 2025
Quasi handled/references here: #190
my PR will either create it because I need it for testing.
or we will change it to the project create.
Either way, I'm already tracking it.