Using the bwagent REST API to Return Selected Fields

You can retrieve information of only selected fields by adding query parameters to the request URL.

The following sample queries show how to retrieve selected fields:

  • Example 1: To check the status of an Application, the REST API GET URL would be -

    http://localhost:8079/bw/v1/domains/<DomainName>/appspaces/<AppspaceName>/applications/<ApplicationName>/<ApplicationVersion>?fields=state

    The URL returns the following response:

    {"state":"Running"}

    Note: Use comma separated fields after the question mark (?) with fields=keyword in the request query. Spaces are not permitted.
  • Example 2: To get AppSpace details

    Normal query - http://localhost:8079/bw/v1/domains/<DomainName>/appspaces/<AppSpaceName>. It returns the total payload, that is, all fields.

  • Select Query: http://localhost:8079/bw/v1/domains/<DomainName>/appspaces/<AppSpaceName>?select=name,status. It retrieves only 2 fields.
  • Sub-field: http://localhost:8079/bw/v1/domains/<DomainName>/appspaces/<AppSpaceName>?select=appSpaceConfigRefs.href. It fetches href of appSpaceConfigRefs.
    Note: The query returns an empty response when the selected field is a collection.