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

/me: default_plan confusion #425

Closed
soxofaan opened this issue Nov 2, 2021 · 2 comments · Fixed by #428
Closed

/me: default_plan confusion #425

soxofaan opened this issue Nov 2, 2021 · 2 comments · Fixed by #428
Assignees
Milestone

Comments

@soxofaan
Copy link
Member

soxofaan commented Nov 2, 2021

openeo-api/openapi.yaml

Lines 3431 to 3441 in f303d65

default_plan:
type: string
nullable: true
description: |-
Name of the plan the user has subscribed to.
Overrides the default plan of the back-end, but back-ends
MAY also allow overriding this plan for each individual
processing request (e.g. job or service) with the
corresponding `plan` property.
example: free

Name of the plan the user has subscribed to.

Field is called "default_plan" but description says "name of the plan the user has subscribed to, so field should be called "plan" instead of the fallback-sounding "default_plan" ?

Overrides the default plan of the back-end, but back-ends
MAY also allow overriding this plan for each individual
processing request (e.g. job or service) with the
corresponding plan property.

I think this paragraph makes it even more confusing. A default that overrides another default: what's the point of the latter default then? And it also suggests that a user can work with multiple plans, so there should be a listing of this under /me as well I guess?

@m-mohr
Copy link
Member

m-mohr commented Nov 2, 2021

Here's how a back-end should resolve it:

  1. If provided, use the plan from the job/web service.
  2. If available, use the default_plan for the user.
  3. Otherwise, use the default_plan of the back-end.

The API can't know what "model" a back-end uses for billing (e.g. whether there's a user default) so it is flexible here (and point two was only added in v1.1 so point 3 is a bit of a legacy thing).

I can try to clarify this in the descriptions.

@m-mohr m-mohr self-assigned this Nov 2, 2021
@m-mohr m-mohr added this to the 1.2.0 milestone Nov 2, 2021
soxofaan added a commit to Open-EO/openeo-python-driver that referenced this issue Nov 3, 2021
soxofaan added a commit to Open-EO/openeo-aggregator that referenced this issue Nov 3, 2021
soxofaan added a commit to Open-EO/openeo-aggregator that referenced this issue Nov 4, 2021
m-mohr added a commit that referenced this issue Nov 4, 2021
@m-mohr m-mohr linked a pull request Nov 4, 2021 that will close this issue
@m-mohr
Copy link
Member

m-mohr commented Nov 4, 2021

Field is called "default_plan" but description says "name of the plan the user has subscribed to, so field should be called "plan" instead of the fallback-sounding "default_plan" ?

Naming is probably not ideal, but we can't change it anymore so I'll try to improve the situation through documentation, see PR #428. The PR should also tackle the other issue raised.

m-mohr added a commit that referenced this issue Dec 15, 2021
* Clarify billing (default) plans #425 #426

* Updates after code review
@m-mohr m-mohr closed this as completed Dec 15, 2021
This was referenced May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants