Setting up and Configuring the Time Series Service
Time Series Service Setup
Like other Predix platform services, authentication for the Time Series service is controlled by the designated trusted issuer and is managed by the User Account and Authentication (UAA) web service. You must set up a UAA service instance as the trusted issuer before getting started with the Time Series service.
Accounts
You should have the following accounts to use Predix services:- A Predix.io account. See Registering for a Predix Account.
When you register for a Predix.io account, an org and space is created for you in Cloud Foundry.
- A Github account. Go to https://github.com/join.
Software
Software | Version | Description |
---|---|---|
Cloud Foundry CLI | Latest stable binary version | Use the Cloud Foundry CLI to deploy and manage applications and services. Download the latest stable binary from https://github.com/cloudfoundry/cli#downloads. |
[AED1] (Optional) Java SE Development Kit (JDK) | 8 |
If you would like to use the Time Series Client Library, you will need Java 8. Download the JDK from |
(Optional) Maven | If you would like to use the Time Series Client Library, you can use Maven to download that dependency. Other build tools like Gradle should work as well. You can download Maven from https://maven.apache.org/download.cgi. |
Task Roadmap
Step | Description |
---|---|
(Optional) Configure your proxy settings. | Depending on your location and network configuration, you may need to configure your proxy settings to access remote resources. |
(Optional) Update your Maven settings to use the Predix platform Artifactory. | To use the Time Series Java client library, you need to include it in your project. See Including the Time Series Client in Your Project. |
(Optional) Deploy a Predix Hello World Web application. | Including the Time Series Client in Your Project. |
Create a UAA client. | See Creating a UAA Service Instance. |
Create the Time Series service instance. | See Creating a Time Series Service Instance. |
Bind your application to the service instance. | See Binding an Application to the Time Series Service Instance. |
Create an OAuth client for the Time Series service. | See Creating an OAuth2 Client. |
Update the OAuth2 client to use Time Series. | See Updating the OAuth2 Client for Services. |
Add the required Time Series scopes. | See Authorities or Scopes Required for Time Series. |
Add Predix zone token scopes to your application. | See Adding Zone Token Scopes to Applications. |
Creating a UAA Service Instance
You can create multiple instances of the UAA service in your space.
About This Task
As a best practice, first delete any older unused instances before creating a new one.
Procedure
Results
Your UAA instance is created with the following specifications:
- A client identifier (
admin
).Note: Anadmin
client is required for bootstrap purposes. You can create additional clients to use with your application. - A client secret (that you specified while creating the service).
To retrieve additional details of your instance, you can bind an application to your instance.
Using the Command Line to Create a UAA Service Instance
Optional procedure for using the command line instead of the graphical user interface to create a UAA service instance.
About This Task
You can create up to 10 instances of UAA service in your space. If you need additional instances, you must delete an older unused instance and create a new one.
Procedure
Results
Your UAA instance is created with the following specification:
-
A client identifier (
admin
).Note: Anadmin
client is created for bootstrap purposes. You can create additional clients to use with your application. -
A client secret (that you specified while creating the service).
To retrieve additional details of your instance, you can bind an application to your instance.
Example
Create a predix-uaa service instance with client secret as admin and sub-domain as ge-digital:
cf cs predix-uaa tiered test-1 -c '{"adminClientSecret":"admin","subdomain":"ge-digital"}'
This is how it appears in VCAP SERVICES when using the cf env <app_name>
command:
"VCAP_SERVICES": {
"predix-uaa": [
{
"credentials": {
"dashboardUrl": "https://uaa-dashboard.run.asv-pr.ice.predix.io/#/login/04187eb1-e0cf-4874-8218-9fb77a8b4ed9",
"issuerId": "https://04187eb1-e0cf-4874-8218-9fb77a8b4ed9.predix-uaa.run.asv-pr.ice.predix.io/oauth/token",
"subdomain": "04187eb1-e0cf-4874-8218-9fb77a8b4ed9",
"uri": "https://04187eb1-e0cf-4874-8218-9fb77a8b4ed9.predix-uaa.run.asv-pr.ice.predix.io",
"zone": {
"http-header-name": "X-Identity-Zone-Id",
"http-header-value": "04187eb1-e0cf-4874-8218-9fb77a8b4ed9"
}
},
"label": "predix-uaa",
"name": "testuaa",
"plan": "Tiered",
"provider": null,
"syslog_drain_url": null,
"tags": [],
"volume_mounts": []
}
],
Creating a Time Series Service Instance
Before You Begin
Complete the tasks in Time Series Service Setup.
Procedure
What To Do Next
Binding an Application to the Time Series Service Instance
About This Task
You must bind your application to the Time Series service instance to provision connection details and credentials for your Time Series service instance in the VCAP_SERVICES environment variable. Cloud Foundry runtime uses VCAP_SERVICES environment variables to communicate with a deployed application about its environment.
Procedure
Creating an OAuth2 Client
You can create OAuth2 clients with specific permissions for your application to work with Predix Platform services. Often this is the first step after creating an instance of a service.
About This Task
When you create an instance of UAA, the UAA Dashboard is available for configuring that instance of UAA. You can use the Client Management tab in the UAA Dashboard to create the OAuth2 clients.
Procedure
What To Do Next
Updating the OAuth2 Client for Services for your service specific information.
Updating the OAuth2 Client for Services
To use an OAuth2 client for secure access to your Predix Platform service instance from your application, you must update your OAuth2 client to add additional authorities or scopes that are specific to each service.
About This Task
acs.policies.read acs.policies.write
. The OAuth2 client uses an authorization grant to request an access token. Based on the type of authorization grant that you have used, you must update your OAuth2 client to generate the required JWT. For more information on how the OAuth2 client is created, see Creating OAuth2 client.
If you use the UAA Dashboard to create additional clients, the client is created for the default client_credentials
grant type. Some required authorities and scopes are automatically added to the client. You must add additional authorities or scopes that are specific to each service.
In addition, the admin client is not assigned the default authority to change the user password. To change the user password, you must add the uaa.admin
authority to your admin client.
Use the following procedure to update the OAuth2 client.
Procedure
What To Do Next
You can complete the following additional tasks in UAA Dashboard:
- If you are using authorization grant type as Authorization Code, Implicit, or Resource Owner Password, you can manage users in UAA.
- You can create password policies for user passwords.
- You can set up external identity provider or use UAA as an identity provider. See Managing Identity Providers.
If you have completed your OAuth2 client setup, you can bind your application to your service instance.
Authorities or Scopes Required for Time Series
- For ingestion requests:
- timeseries.zones.<Predix-Zone-Id>.user
- timeseries.zones.<Predix-Zone-Id>.ingest
- For query requests:
- timeseries.zones.<Predix-Zone-Id>.user
- timeseries.zones.<Predix-Zone-Id>.query
The OAuth2 client uses an authorization grant to request an access token. OAuth2 defines four grant types. Based on the type of authorization grant that you use, you must update your OAuth2 client to generate the required JWT. For more information on how the OAuth2 client is created, see Creating an OAuth2 Client.