Class SolarQueryLocationApi

SolarQuery location API URL helper.

Hierarchy

  • LocationDatumMetadataUrlHelperMixin<{
        prototype: LocationDatumUrlHelperMixin<any>;
        new (...args): LocationDatumUrlHelperMixin<{
            prototype: LocationsUrlHelperMixin<any>;
            new (...args): LocationsUrlHelperMixin<typeof SolarQueryUrlHelper>;
        } & typeof SolarQueryUrlHelper>;
    } & {
        prototype: LocationsUrlHelperMixin<any>;
        new (...args): LocationsUrlHelperMixin<typeof SolarQueryUrlHelper>;
    } & typeof SolarQueryUrlHelper, this> & LocationDatumUrlHelperMixin<{
        prototype: LocationsUrlHelperMixin<any>;
        new (...args): LocationsUrlHelperMixin<typeof SolarQueryUrlHelper>;
    } & typeof SolarQueryUrlHelper, this> & LocationsUrlHelperMixin<typeof SolarQueryUrlHelper, this> & SolarQueryUrlHelper<this>
    • SolarQueryLocationApi

Constructors

  • Constructor.

    Parameters

    • Optional environment: HostConfigInfo

      the optional initial environment to use; if a non-Environment object is passed then the properties of that object will be used to construct a new Environment instance

    Returns SolarQueryLocationApi

Properties

The network environment (host, port, and so on).

#parameters: Configuration

Parameters for URL variables.

Accessors

  • get parameters(): Configuration
  • Get a parameters object that can be used to hold URL variables.

    Returns Configuration

  • get publicQuery(): boolean
  • The publicQuery environment parameter.

    Returns boolean

  • set publicQuery(value): void
  • Parameters

    • value: boolean

    Returns void

Methods

  • Get a base URL for location datum metadata operations using a specific location ID.

    Parameters

    • Optional locationId: number

      a specific location ID to use; if not provided the locationId parameter of this instance will be used

    Returns string

    the base URL

  • Parameters

    • Optional locationId: number
    • Optional sourceId: string

    Returns string

  • Generate a URL for adding (merging) datum metadata via a POST request.

    Parameters

    • Optional locationId: number

      a specific location ID to use; if not provided the locationId parameter of this instance will be used

    • Optional sourceId: string

      a specific source ID to use; if not provided the sourceId parameter of this instance will be used

    Returns string

    the URL

  • Generate a URL for finding the available source IDs for a location or metadata filter.

    Parameters

    • Optional locationId: number
    • Optional startDate: Date

      a start date to limit the search to

    • Optional endDate: Date

      an end date to limit the search to

    Returns string

    the URL

  • Get the base URL to the REST API.

    Returns string

    the base URL to the REST API

  • Get a new configured with parameters of this instance.

    This will look for the following parameters:

    • nodeIds
    • sourceIds

    Returns DatumFilter

    the filter

  • Generate a URL for deleting datum metadata via a DELETE request.

    Parameters

    • Optional locationId: number

      a specific location ID to use; if not provided the locationId parameter of this instance will be used

    • Optional sourceId: string

      a specific source ID to use; if not provided the sourceId parameter of this instance will be used

    Returns string

    the URL

  • Get or set an environment parameter.

    This is a shortcut for calling Util.Configuration#value on the environment object.

    Parameters

    • key: string

      the environment parameter name to get

    Returns any

    when called as a getter, the environment parameter value; when called as a setter, the environment object

  • Parameters

    • key: string
    • newValue: any

    Returns EnvironmentConfig & HostConfig

  • Generate a URL for searching for location metadata.

    Parameters

    • filter: DatumFilter

      a search filter; the locationIds, sourceIds, tags, query, and location properties are supported

    • Optional sorts: SortDescriptor[]

      optional sort settings to use

    • Optional pagination: Pagination

      optional pagination settings to use

    Returns string

    the URL

  • Generate a URL to find locations based on a search criteria.

    Parameters

    • filter: Location

      the search criteria

    • Optional sorts: SortDescriptor[]

      optional sort settings to use

    • Optional pagination: Pagination

      optional pagination settings to use

    Returns string

    the generated URL

  • Get a URL for just the SolarNet host, without any path to be used for actual requests.

    Calls the toRequestUrl() with hostUrl() as the argument.

    Returns string

    the URL to make reqeusts to the SolarNet host

  • Get a URL for just the SolarNet host, without any path.

    This method constructs an absolute URL based on the following properties configured on this instance's Net.Environment:

    1. If environment.useTls() returns true then use HTTPS as the protocol, otherwise HTTP.
    2. Use host for the host name or IP address.
    3. Use port for the port if available and not the standard 443 for HTTPS or 80 for HTTP.

    Returns string

    the URL to the SolarNet host

  • Get a URL for just the SolarNet host using the WebSocket protocol, without any path.

    This method constructs an absolute URL based on the following properties configured on this instance's Net.Environment:

    1. If environment.useTls() returns true then use WSS as the protocol, otherwise WS.
    2. Use host for the host name or IP address.
    3. Use port for the port if available and not the standard 443 for WSS or 80 for WS.

    Returns string

    the URL to the SolarNet host WebSocket

  • Generate a URL for querying for location datum, in either raw or aggregate form.

    If the datumFilter has an aggregate value set, then aggregate results will be returned by SolarNet.

    Parameters

    • Optional datumFilter: DatumFilter

      the search criteria

    • Optional sorts: SortDescriptor[]

      optional sort settings to use

    • Optional pagination: Pagination

      optional pagination settings to use

    Returns string

    the URL

  • Generate a URL for querying for the most recent datum.

    Parameters

    • Optional datumFilter: DatumFilter

      the search criteria

    • Optional sorts: SortDescriptor[]

      optional sort settings to use

    • Optional pagination: Pagination

      optional pagination settings to use

    Returns string

    the URL

  • Get a parameter, with plural suffix array support.

    This method will first look for a parameter named exactly key, and if found return that. Otherwise it will look for an array parameter named key with s appended, and if found return the first element from that array. For example:

    const helper = new UrlHelper();
    helper.parameter('nodeIds', [1, 2, 3]);

    helper.param('nodeIds'); // [1, 2, 3]
    helper.param('nodeId'); // 1

    If key already ends in s, then a desired array result is assumed. If a value is not found for the parameter, then s is removed from key and that parameter value is returned, as an array if it is not already. For example:

    const helper = new UrlHelper();
    helper.parameter('nodeId', 1);

    helper.param('nodeIds'); // [1]
    helper.param('nodeId'); // 1

    Type Parameters

    • T

      the expected type

    Parameters

    • key: string

      the parameter name to get

    Returns undefined | T

    the parameter value

  • Get or set a parameter.

    This is a shortcut for calling Util.Configuration#value on the parameters object.

    Parameters

    • key: string

      the parameter name to get

    Returns any

    when called as a getter, the parameter value; when called as a setter, the parameters object

  • Parameters

    • key: string
    • newValue: any

    Returns Configuration

  • Generate a URL for setting datum metadata via a PUT request.

    Parameters

    • Optional locationId: number

      a specific location ID to use; if not provided the locationId parameter of this instance will be used

    • Optional sourceId: string

      a specific source ID to use; if not provided the sourceId parameter of this instance will be used

    Returns string

    the URL

  • Generate a URL for the "reportable interval" for a location, optionally limited to a specific source ID.

    If no source IDs are provided, then the reportable interval query will return an interval for all available sources.

    Parameters

    • Optional locationId: number

      a specific location ID to use; if not provided the locationId parameter of this instance will be used

    • Optional sourceId: string

      a specific source ID to limit query to; if not provided the sourceId parameter of this instance will be used;

    Returns string

    the URL

  • Replace occurances of URL template variables with values from the parameters property and append to the host URL.

    This method provides a way to resolve an absolute URL based on the configured environment and parameters on this object.

    Parameters

    • template: string

      a URL path template

    Returns string

    an absolute URL

  • Replace occurances of URL template variables with values from the parameters property.

    URL template variables are specified as {<em>name</em>}. The variable will be replaced by the value associated with property name in the parameters object. The value will be URI encoded.

    Parameters

    • template: string

      a URL template

    Returns string

    the URL with template variables resolved

  • Get the URL to actually request, incorporating the environment's proxyUrlPrefix if available.

    If a environment.proxyUrlPrefix value is configured, this will re-write the URL to use that host prefix, otherwise url will be returned unchanged.

    Parameters

    • url: string

    Returns string

    the URL to make reqeusts to the SolarNet host

  • Generate a URL for viewing datum metadata.

    If no sourceId is provided, then the API will return all available datum metadata for all sources.

    Parameters

    • Optional locationId: number

      a specific location ID to use; if not provided the locationId parameter of this instance will be used

    • Optional sourceId: string

      a specific source ID to use; if not provided the sourceId parameter of this instance will be used; if null then ignore any sourceId property of this class

    Returns string

    the URL

  • Replace occurances of URL template variables with values from a parameter object.

    URL template variables are specified as {<em>name</em>}. The variable will be replaced by the value associated with property name in the provided parameter object. The value will be URI encoded.

    Any occurances of // after replacing template variables will be reduced to /.

    Parameters

    • template: string

      a URL template

    • params: Record<string, any>

      an object whose properties should serve as template variables

    Returns string

    the URL

Generated using TypeDoc