Skip to content

Fields support #248

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krismarc
Copy link

@krismarc krismarc commented Jul 14, 2025

Fields support. No idea if it fits into your design. However, if you agree, I could come up with some tests, readme update etc.

Fields param as specified in the API description. Navigable object would contain only data from includes returned by fields query params.

fields = {"space.organization": ["guid", "name"], "space": ["guid,name,relationships.organization"] }
service_instances = client.v3.service_instances.list(fields=fields)

for service_instance in service_instances:
    space = service_instance.space()
    org = space.organization()
    print("Org name:" + org["name"])
    break
./test.py
debug: https://api.appcloudtest.company.com/v3/service_instances?fields[space.organization]=guid%2Cname&fields[space]=guid%2Cname%2Crelationships.organization
debug: manager_name: spaces
debug: manager_name: organizations
debug: ENTITY: {'guid': '6ce6284f-3024-4d4c-8df6-b6856454bba9', 'name': 'MY_ORG'}
debug: ENTITY: {'guid': '308da49b-f710-4a9f-b267-131d4f81cc0d', 'name': 'MAIN', 'relationships': {'organization': {'data': {'guid': '6ce6284f-3024-4d4c-8df6-b6856454bba9'}}}}
Org name: MY_ORG

Fields support.
https://v3-apidocs.cloudfoundry.org/version/3.197.0/index.html#fields
As specified in the API description. Navigable object would contain only data from includes returned by fields query params.
@krismarc krismarc mentioned this pull request Jul 14, 2025
@krismarc krismarc changed the title Update entities.py FIelds support Jul 14, 2025
@krismarc krismarc changed the title FIelds support Fields support Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant