Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose execution status as virtual property on job resource - teraslice api #3770

Closed
godber opened this issue Sep 25, 2024 · 4 comments
Closed

Comments

@godber
Copy link
Member

godber commented Sep 25, 2024

Would it make sense to expose the ex._status property as .status or perhaps .exStatus on the Teraslice job API resources?

I would expect this to be implemented by making a request to see if a current ex exists for the job, if so, return it's status, if not, return ... 🤷

This would simplify a lot of client side logic. I am not sure what the downsides would be. The extra DB requests of course. Anything else?

See also #535 , this is effectively a duplicate of that.

@busma13
Copy link
Contributor

busma13 commented Sep 25, 2024

In teraslice-cli we give the job a registered status if there isn't an execution

export interface JobMetadata {
    id: string;
    api: Job;
    config: Teraslice.JobConfig;
    status: Teraslice.ExecutionStatus | RegisteredStatus;
}

export type RegisteredStatus = keyof typeof RegisteredStatusEnum;

export enum RegisteredStatusEnum {
    no_execution = 'no_execution'
}

@godber
Copy link
Member Author

godber commented Sep 26, 2024

I talked with Kimbro about this a little bit today and he suggested if we chose to go this route we should probably make a distinction between this "virtual property" (if there's a word for this someone let me know) and the other properties. That way if we start extending the use of this technique, they will all be grouped together.

So maybe something like

"_ex": {
  "status": "running"
}

@godber
Copy link
Member Author

godber commented Oct 1, 2024

Perhaps the extra property would only be included if ?include=ex were added as a query parameter.

@godber
Copy link
Member Author

godber commented Oct 22, 2024

This PR:

#3792

only added the functionality to /jobs/<JOB_ID>. We want it added to /jobs too ...

godber pushed a commit that referenced this issue Oct 23, 2024
This PR makes the following changes:

## New Features
- Adds a feature introduced on #3792 into the `v1/jobs` endpoint
- Now you can list several jobs with their associated ex information in
one api call

## Documentation
- Updated `management api` docs to reflect changes to `v1/jobs` endpoint

## Bumps
- **teraslice** from `v2.6.1` to `v2.6.2`

Ref to issue #3770
@sotojn sotojn closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants