Class CogniteClient

    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
    • Constructor Detail

      • CogniteClient

        public CogniteClient()
    • Method Detail

      • create

        public static CogniteClient create()
                                    throws Exception
        Returns a CogniteClient using an API key from the system's environment variables (COGNITE_API_KEY) and using default settings.
        Returns:
        the client object.
        Throws:
        Exception - if the api key cannot be read from the system environment.
      • toBuilder

        protected abstract com.cognite.client.CogniteClient.Builder toBuilder()
      • getApiKey

        protected abstract String getApiKey()
      • getProject

        @Nullable
        protected abstract String getProject()
      • getBaseUrl

        protected abstract String getBaseUrl()
      • getClientConfig

        public abstract ClientConfig getClientConfig()
      • getHttpClient

        public okhttp3.OkHttpClient getHttpClient()
      • getExecutorService

        public ForkJoinPool getExecutorService()
      • withApiKey

        public CogniteClient withApiKey​(String key)
        Returns a CogniteClient using the specified api key.
        Parameters:
        key - The api key to use for interacting with Cognite Data Fusion.
        Returns:
        the client object with the api key set.
      • withProject

        public CogniteClient withProject​(String project)
        Returns a CogniteClient using the specified Cognite Data Fusion project / tenant.
        Parameters:
        project - The project / tenant to use for interacting with Cognite Data Fusion.
        Returns:
        the client object with the project / tenant key set.
      • withBaseUrl

        public CogniteClient withBaseUrl​(String baseUrl)
        Returns a CogniteClient using the specified base URL for issuing API requests. The base URL must follow the format https://<my-host>.cognitedata.com. The default base URL is https://api.cognitedata.com
        Parameters:
        baseUrl - The CDF api base URL
        Returns:
        the client object with the base URL set.
      • withClientConfig

        public CogniteClient withClientConfig​(ClientConfig config)
        Returns a CogniteClient using the specified configuration settings.
        Parameters:
        config - The ClientConfig hosting the client configuration setting.
        Returns:
        the client object with the config applied.
      • assets

        public Assets assets()
        Returns Assets representing the Cognite assets api endpoint.
        Returns:
        The assets api object.
      • timeseries

        public Timeseries timeseries()
        Returns Timeseries representing the Cognite timeseries api endpoint.
        Returns:
        The timeseries api object.
      • events

        public Events events()
        Returns Events representing the Cognite events api endpoint.
        Returns:
        The events api object.
      • files

        public Files files()
        Returns Files representing the Cognite files api endpoints.
        Returns:
        The labels api endpoint.
      • relationships

        public Relationships relationships()
        Returns Relationships representing the Cognite relationships api endpoint.
        Returns:
        The relationships api object.
      • sequences

        public Sequences sequences()
        Returns Sequences representing the Cognite sequences api endpoint.
        Returns:
        The sequences api object.
      • raw

        public Raw raw()
        Returns Raw representing the Cognite Raw service.
        Returns:
        The raw api object.
      • labels

        public Labels labels()
        Returns Labels representing the Cognite labels api endpoints.
        Returns:
        The labels api endpoint.
      • datasets

        public Datasets datasets()
        Returns Datasets representing the Cognite dats sets api endpoint.
        Returns:
        The data sets api object.
      • securityCategories

        public SecurityCategories securityCategories()
        Returns SecurityCategories representing the Cognite labels api endpoints.
        Returns:
        The security categories api endpoint.
      • contextualization

        public Contextualization contextualization()
        Returns Contextualization representing the Cognite contextualization api endpoints.
        Returns:
        The contextualization api endpoint.
      • experimental

        public Experimental experimental()
        Returns Experimental representing experimental (non-released) api endpoints.
        Returns:
        The Experimental api endpoints.
      • getConnectorService

        protected ConnectorServiceV1 getConnectorService()
        Returns the services layer mirroring the Cognite Data Fusion API.
        Returns:
      • buildAuthConfig

        protected AuthConfig buildAuthConfig()
                                      throws Exception
        Returns a auth info for api requests
        Returns:
        project config with auth info populated
        Throws:
        Exception