Skip to content

Possibility to retrive includes? #218

Open
@krismarc

Description

@krismarc

Hey, not sure if it's missing or I don't know how to exactly use it. However, I can't retrieve 'included' from any out of the box options eg. list, get, get_first. However, if I get retrieved payload from underlying methods then it's there. So I assume, parameter is passed while calling API, however, method returning payload only process 'resources' and 'included' is omitted.

Using CF CLI:

cf curl /v3/apps/9a81aaf5-7dac-4adc-a764-263b98935707?include=org | jq -r .included.organizations[].guid
42b716bb-42c5-4bcf-9c1c-f4be4d11685b

Using Python client:

app = client.v3.apps.get("9a81aaf5-7dac-4adc-a764-263b98935707", include="org")
print(json.dumps(app["included"], indent=4))
    print(json.dumps(app["included"], indent=4))
KeyError: 'included'

By changing the first line only, a single request fetches all the data. The navigation from app to space and space to organization remains unchanged.
app = client.v3.apps.get("app-guid", include="space.organization")

The managers provide the same methods as the V2 managers with the following differences:
get(**kwargs): supports keyword arguments that are passed on to the API, e.g. "include"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions