Endpoint URLs
The base URLs come from the service instance. To find the URL, view the service credentials by clicking the name of the service in the Resource list and going to Service credentials. Use the value of the URL. Add the method to form the complete API endpoint for your request.
Authentication
Required Purpose: To work with the API, you must use an IBM Cloud Identity and Access Management (IAM) access token. The token is used to determine the actions that a user or service ID has access to when they use the API.
You can generate an IAM token for an authenticated user or service ID by using the IAM Identity Services API. IAM tokens are generated by using the user or service ID's API key. For more information, see Generating an IBM Cloud IAM token by using an API key.
To use the API, add a valid IAM token to the HTTP Authorization request header, for example, -H 'Authorization: Bearer {TOKEN}'
.
To retrieve your access token:
curl -X POST "https://iam.cloud.ibm.com/identity/token" --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --data-urlencode 'grant_type=urn:ibm:params:oauth:grant-type:apikey' --data-urlencode 'apikey={API_KEY}'
Replace {API_KEY}
with your IAM API key.
Auditing
Required if applicable Purpose: Describes that the API generates auditing events that can be consumed by the Activity Tracker service, and links to your related product docs for more information. Required only if any of the API's methods is enabled to generate auditing events.
Example:
You can monitor API activity within your account by using the IBM Cloud Activity Tracker service. Whenever an API method is called, an event is generated that you can then track and audit from within Activity Tracker. The specific event type is listed for each individual method.
For more information about how to track Certificate Manager activity, see Auditing events for Certificate Manager.
Error handling
This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200
response indicates success. A 400
type response indicates a failure, and a 500
type response indicates an internal system error.
HTTP Error Code | Description | Recovery |
---|---|---|
200 |
Success | The request was successful. |
201 |
Created | The requested resource successfully created in a synchronous manner. |
204 |
No Content | The server successfully processed the request and is not returning any content. |
400 |
Bad Request | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |
401 |
Unauthorized | You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions. |
403 |
Forbidden | The supplied authentication is not authorized to access '{namespace}'. |
404 |
Not Found | The requested resource could not be found. |
409 |
Conflict | The entity is already in the requested state. |
429 |
Rate limit reached | the client application has surpassed its rate limit, or number of requests they can send in a given period of time. |
500 |
Internal Server Error | Your request could not be processed. Wait a few minutes and try again. |
Rate limiting
The API has limits in place to ensure stability and prevent abuse. Our current API limits are as follows:
- Maximum requests per second: 10
- Maximum requests per day: 5,000
If these limits are exceeded, you will start running into 429 HTTP errors. And so we ask you to please take these limits into consideration while writing code that uses the API.
This is especially relevant when managing clusters via API, as clusters can be in a pending state for up to several minutes as they’re being modified.
Methods
Delete cluster
This will completely delete the cluster. All queries running will fail. All information about the cluster and any managed catalog information will be deleted
DELETE /v1/clusters/{id}
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
Delete query log s3 bucket attached to this cluster.
Delete S3 bucket attached to the managed HMS for this cluster.
curl --request DELETE --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id} --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"deleteQueryLogBucket":true,"deleteHiveBucket":true}'
const request = require('request'); const options = { method: 'DELETE', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: {deleteQueryLogBucket: true, deleteHiveBucket: true}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}" payload := strings.NewReader("{\"deleteQueryLogBucket\":true,\"deleteHiveBucket\":true}") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"deleteQueryLogBucket\":true,\"deleteHiveBucket\":true}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("DELETE", "/v1/clusters/{id}", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"deleteQueryLogBucket\":true,\"deleteHiveBucket\":true}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}") .delete(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
curl --request GET --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id} --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'GET', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("GET", "/v1/clusters/{id}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}") .get() .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Response
The unique identifier of the cluster
The name of the cluster
The number of total worker nodes in the cluster
HATEOAS links to modify the state of the cluster. Only actions that are allowed in the cluster's current state are returned in the model.
- _actions
Provides the URI to start the cluster, if currently allowed
Provides the URI to stop the cluster, if currently allowed
Provides the URI to restart the cluster, if currently allowed
Provides the URI to modify the number of worker nodes allocated for the cluster, if currently allowed
Provides the URI to modify the autoscaling configuration for the cluster, if currently allowed
Provides the URI to get the attached data sources for the cluster, if currently allowed
Provides the URI to get the attached presto users for the cluster, if currently allowed
Provides the URI to modify the attached data sources on the cluster, if currently allowed
Provides the URI to modify the attached presto users on the cluster, if currently allowed
Provides the URI to modify the grouped config on the cluster, if currently allowed
Provides the URI to delete the cluster, if currently available
The workload profile for the cluster.
The provisioned Presto coordinator AWS EC2 instance type.
The provisioned Presto worker AWS EC2 instance type.
The grace period for running queries to finish before forcefully terminating the Presto workers during scale in.
A collection of error messages from the last operation on the cluster
Indicates if the managed HMS is enabled and pre-attached as a catalog to the Presto Cluster.
Indicates whether data IO cache is enabled. When enabled each Presto worker will cache the data from Amazon S3 to a local AWS EBS SSD drive which improves query performance.
Possible values: [
alluxio-lite
,rubix
]Indicates whether the intermediate result set cache is enabled. When enabled each Presto worker can cache partially computed results on the worker's local AWS EBS SSD drive. This prevents duplicated computation upon multiple queries which will improve query performance and decrease CPU usage.
The provisioned AWS EC2 instance type for the managed HMS.
The auto scaling configuration for the cluster
- autoScaling
To control costs, you can enable scaling down to a single worker node when idle. Idle is defined as not receiving any query during the time window specified below. When a cluster is scaled down to a single worker node due to being idle, it is in the idle state. If the cluster receives a query while in the idle state, it will automatically scale back out to the worker node count.
Possible values: [
idleCostSavings
]A Presto worker is responsible for executing tasks and processing data. Worker nodes fetch data from connectors and exchange intermediate data with each other. The coordinator is responsible for fetching results from the workers and returning the final results to the client. Enter the number of worker nodes you want in the Presto cluster. Pick a number between 1 and 100. The coordinator node is not included in this worker node count.
The time window over which if no queries are received the cluster is considered idle.
Custom Tag keys and values for Presto cluster.
Whether Presto workers are provisioned by Presto C++ or java.
Possible values: [
prestoCPP
,java
]The list of identifiers of the presto routers to which the cluster is attached.
The Subnet (private) used for this presto cluster.
The Presto version used.
Status Code
Success
Error
No Sample Response
Get attached data sources
Returns all data sources attached to the cluster
GET /v1/clusters/{id}/datasources
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
curl --request GET --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/datasources --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'GET', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/datasources', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/datasources" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("GET", "/v1/clusters/{id}/datasources", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/datasources") .get() .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Update attached data sources
Set the data sources attached to the cluster. Invoking this end point will cause running clusters to restart.
PUT /v1/clusters/{id}/datasources
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
The complete list of data source ids to attach to this cluster.
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/datasources --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"dataSourceIds":["string"]}'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/datasources', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: {dataSourceIds: ['string']}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/datasources" payload := strings.NewReader("{\"dataSourceIds\":[\"string\"]}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"dataSourceIds\":[\"string\"]}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("PUT", "/v1/clusters/{id}/datasources", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"dataSourceIds\":[\"string\"]}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/datasources") .put(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Get attached Presto users
Returns all Presto users attached to the cluster
GET /v1/clusters/{id}/prestousers
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
curl --request GET --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/prestousers --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'GET', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/prestousers', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/prestousers" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("GET", "/v1/clusters/{id}/prestousers", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/prestousers") .get() .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Update attached Presto users
Set the Presto users attached to the cluster. Please wait a couple of minutes for the credentials change to take effect.
PUT /v1/clusters/{id}/prestousers
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
The complete list of Presto user ids to attach to this cluster.
Possible values: number of items ≥ 1
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/prestousers --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"prestoUserIds":["string"]}'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/prestousers', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: {prestoUserIds: ['string']}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/prestousers" payload := strings.NewReader("{\"prestoUserIds\":[\"string\"]}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"prestoUserIds\":[\"string\"]}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("PUT", "/v1/clusters/{id}/prestousers", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"prestoUserIds\":[\"string\"]}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/prestousers") .put(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
curl --request GET --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'GET', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("GET", "/v1/clusters", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters") .get() .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
Pick a cluster name. This is unique across the compute plane. We recommend a descriptive name to help you identity clusters. It will also be used as part of the cluster endpoints. The cluster name must begin and end with a letter or number. It can be a maximum of 63 characters long.
The Presto coordinator is responsible for parsing statements, planning queries and scheduling queries. Clients like JDBC / ODBC / PrestoCli connect to the coordinator to submit statements for execution. Every Presto installation must have a Presto coordinator alongside one or more Presto workers. Select the AWS EC2 instance type to be provisioned for the Presto Coordinator.
A Presto worker is responsible for executing tasks and processing data. Worker nodes fetch data from connectors and exchange intermediate data with each other. The coordinator is responsible for fetching results from the workers and returning the final results to the client. Select the AWS EC2 instance type to be provisioned for the Presto cluster worker nodes. If you have selected a "d" type EC2 instance and then both data IO and intermediate result set cache will be enabled using the instance storage by default instead of EBS volumes
Reducing Presto workers on a cluster will gracefully shutdown workers so that any running queries will not fail due to the scale in. The query termination grace period is the maximum time window that is allowed for existing query tasks to complete on Presto workers before forcefully terminating those workers.
Possible values: 60 ≤ value ≤ 7200
Low concurrency is useful for clusters that run a limited number of queries or a few large, complex queries. It also supports bigger and heavier ETL jobs. High concurrency is better for running multiple queries at the same time. For example, dashboard and reporting queries or A/B testing analytics, etc. This setting can be changed once the cluster has been created and cluster restart is not required. However, the change will only apply to new queries.
Allowable values: [
low
,high
]Possible values: number of items ≥ 1
Enter the number of worker nodes you want in the Presto cluster. Pick a number between 1 and 100. The coordinator node is not included in this worker node count.
Possible values: value ≥ 1
Select the AWS availability zone where you would like to deploy your Presto cluster. If you omit this value, we will try to determine the optimal availability zone when it is deployed.
Hive Metastore maps files in data lakes / object stores to databases, tables and columns queryable by SQL. Checking this box will provision a Hive Metastore that is pre-attached as a catalog to the Presto Cluster. The metadata for any tables created can be stored in this catalog. The metastore is also pre-configured with an S3 bucket where the data for tables defined is stored. You can pre-attach a Hive Metastore to every cluster. In order to preserve the Metadata, the Hive Metastore will still be running after the Presto Cluster has been stopped.
Hive Metastore maps files in data lakes / object stores to databases, tables and columns queryable by SQL. Select the AWS EC2 instance type to be provisioned for the the Hive Metastore instance.
Enabling data IO cache lets you cache the data from Amazon S3 to a local AWS EBS SSD drive per Presto worker which will improve your query performance. The size of the cache configured depends on the Presto worker AWS instance type. The total size of the EBS SSD volume configured is 3 times the size of the memory of the AWS instance selected. If you have selected a "d" type EC2 instance then both data IO and intermediate result set cache will be enabled using the instance storage by default instead of EBS volumes.
Allowable values: [
alluxio-lite
]Enabling intermediate result set cache lets you cache partially computed results set on the worker's local AWS EBS SSD drive. This is to prevent duplicated computation upon multiple queries which will improve your query performance and decrease CPU usage. Intermediate result set cache is only beneficial for the workloads with aggregation queries. The size of the cache configured depends on the Presto worker AWS instance type. The total size of the EBS SSD volume configured is 2 times the size of the memory of the AWS instance selected. If you have selected a 'd' type EC2 instance then both data IO and intermediate result set cache will be enabled using the instance storage by default instead of EBS volumes.
- autoScaling
To control costs, you can enable scaling down to a single worker node when idle. Idle is defined as not receiving any query during the time window specified below. When a cluster is scaled down to a single worker node due to being idle, it is in the idle state. If the cluster receives a query while in the idle state, it will automatically scale back out to the worker node count.
Allowable values: [
idleCostSavings
]A Presto worker is responsible for executing tasks and processing data. Worker nodes fetch data from connectors and exchange intermediate data with each other. The coordinator is responsible for fetching results from the workers and returning the final results to the client. Enter the number of worker nodes you want in the Presto cluster. Pick a number between 1 and 100. The coordinator node is not included in this worker node count.
Possible values: value ≥ 1
The time window over which if no queries are received the cluster is considered idle.
Possible values: 5 ≤ value ≤ 60
Specify Custom Tag keys and values when creating a Presto cluster.
Whether Presto workers are provisioned by Presto C++ or java.
Allowable values: [
prestoCPP
,java
]Specify the private Subnet ID for the Presto Cluster.
Specify the version for Presto.
curl --request POST --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"name":"string","coordinatorInstanceType":"string","workerInstanceType":"string","workerNodes":1,"availabilityZone":"string","workerTerminationGracePeriod":60,"enableAhanaManagedHMS":true,"hmsInstanceType":"string","concurrency":"low","enableDataCache":"alluxio-lite","enableFragmentResultCache":true,"prestoUserIds":["string"],"autoScaling":{"type":"idleCostSavings","workerNodes":1,"idleTime":5},"customTags":{},"workerContainerType":"prestoCPP"}'
const request = require('request'); const options = { method: 'POST', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: { name: 'string', coordinatorInstanceType: 'string', workerInstanceType: 'string', workerNodes: 1, availabilityZone: 'string', workerTerminationGracePeriod: 60, enableAhanaManagedHMS: true, hmsInstanceType: 'string', concurrency: 'low', enableDataCache: 'alluxio-lite', enableFragmentResultCache: true, prestoUserIds: ['string'], autoScaling: {type: 'idleCostSavings', workerNodes: 1, idleTime: 5}, customTags: {}, workerContainerType: 'prestoCPP' }, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters" payload := strings.NewReader("{\"name\":\"string\",\"coordinatorInstanceType\":\"string\",\"workerInstanceType\":\"string\",\"workerNodes\":1,\"availabilityZone\":\"string\",\"workerTerminationGracePeriod\":60,\"enableAhanaManagedHMS\":true,\"hmsInstanceType\":\"string\",\"concurrency\":\"low\",\"enableDataCache\":\"alluxio-lite\",\"enableFragmentResultCache\":true,\"prestoUserIds\":[\"string\"],\"autoScaling\":{\"type\":\"idleCostSavings\",\"workerNodes\":1,\"idleTime\":5},\"customTags\":{},\"workerContainerType\":\"prestoCPP\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"name\":\"string\",\"coordinatorInstanceType\":\"string\",\"workerInstanceType\":\"string\",\"workerNodes\":1,\"availabilityZone\":\"string\",\"workerTerminationGracePeriod\":60,\"enableAhanaManagedHMS\":true,\"hmsInstanceType\":\"string\",\"concurrency\":\"low\",\"enableDataCache\":\"alluxio-lite\",\"enableFragmentResultCache\":true,\"prestoUserIds\":[\"string\"],\"autoScaling\":{\"type\":\"idleCostSavings\",\"workerNodes\":1,\"idleTime\":5},\"customTags\":{},\"workerContainerType\":\"prestoCPP\"}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("POST", "/v1/clusters", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"name\":\"string\",\"coordinatorInstanceType\":\"string\",\"workerInstanceType\":\"string\",\"workerNodes\":1,\"availabilityZone\":\"string\",\"workerTerminationGracePeriod\":60,\"enableAhanaManagedHMS\":true,\"hmsInstanceType\":\"string\",\"concurrency\":\"low\",\"enableDataCache\":\"alluxio-lite\",\"enableFragmentResultCache\":true,\"prestoUserIds\":[\"string\"],\"autoScaling\":{\"type\":\"idleCostSavings\",\"workerNodes\":1,\"idleTime\":5},\"customTags\":{},\"workerContainerType\":\"prestoCPP\"}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters") .post(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Update worker node count
Modify the number of worker nodes for a cluster
PATCH /v1/clusters/{id}/workernodes
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
The number of total worker nodes in the cluster
curl --request PATCH --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/workernodes --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"workerNodes":0}'
const request = require('request'); const options = { method: 'PATCH', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/workernodes', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: {workerNodes: 0}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/workernodes" payload := strings.NewReader("{\"workerNodes\":0}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"workerNodes\":0}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("PATCH", "/v1/clusters/{id}/workernodes", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"workerNodes\":0}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/workernodes") .patch(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Update autoscaling policy
Set the autoscaling policy for this cluster.
PUT /v1/clusters/{id}/autoscaling
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
To control costs, you can enable scaling down to a single worker node when idle. Idle is defined as not receiving any query during the time window specified below. When a cluster is scaled down to a single worker node due to being idle, it is in the idle state. If the cluster receives a query while in the idle state, it will automatically scale back out to the worker node count.
Allowable values: [
idleCostSavings
]A Presto worker is responsible for executing tasks and processing data. Worker nodes fetch data from connectors and exchange intermediate data with each other. The coordinator is responsible for fetching results from the workers and returning the final results to the client. Enter the number of worker nodes you want in the Presto cluster. Pick a number between 1 and 100. The coordinator node is not included in this worker node count.
Possible values: value ≥ 1
The time window over which if no queries are received the cluster is considered idle.
Possible values: 5 ≤ value ≤ 60
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/autoscaling --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"type":"idleCostSavings","workerNodes":1,"idleTime":5}'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/autoscaling', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: {type: 'idleCostSavings', workerNodes: 1, idleTime: 5}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/autoscaling" payload := strings.NewReader("{\"type\":\"idleCostSavings\",\"workerNodes\":1,\"idleTime\":5}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"type\":\"idleCostSavings\",\"workerNodes\":1,\"idleTime\":5}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("PUT", "/v1/clusters/{id}/autoscaling", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"type\":\"idleCostSavings\",\"workerNodes\":1,\"idleTime\":5}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/autoscaling") .put(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Update workload profile
Select a workload type for your cluster that suits the type of queries you are planning to run. Low concurrency is useful for clusters that run a limited number of queries or a few large, complex queries. It also supports bigger and heavier ETL jobs. High concurrency is better for running multiple queries at the same time. For example, dashboard and reporting queries or A/B testing analytics, etc. This setting can be changed once the cluster has been created and cluster restart is not required. However, the change will only apply to new queries.
PUT /v1/clusters/{id}/groupedconfig
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
Workload Profile:
low
- Low concurrency is useful for clusters that run a limited number of queries or a few large, complex queries. It also supports bigger and heavier ETL jobs.high
- High concurrency is better for running multiple queries at the same time. For example, dashboard and reporting queries or A/B testing analytics, etc.
Allowable values: [
low
,high
]
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/groupedconfig --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"concurrency":"low"}'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/groupedconfig', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: {concurrency: 'low'}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/groupedconfig" payload := strings.NewReader("{\"concurrency\":\"low\"}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"concurrency\":\"low\"}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("PUT", "/v1/clusters/{id}/groupedconfig", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"concurrency\":\"low\"}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/groupedconfig") .put(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Restart cluster
Trigger the cluster restart workflow if in active state
PUT /v1/clusters/{id}/restart
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/restart --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/restart', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/restart" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("PUT", "/v1/clusters/{id}/restart", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/restart") .put(null) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/start --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/start', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/start" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("PUT", "/v1/clusters/{id}/start", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/start") .put(null) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the cluster
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/stop --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/stop', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/stop" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("PUT", "/v1/clusters/{id}/stop", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/clusters/{id}/stop") .put(null) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
curl --request GET --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestousers --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'GET', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestousers', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestousers" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("GET", "/v1/prestousers", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestousers") .get() .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
curl --request GET --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/datasources --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'GET', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/datasources', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/datasources" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("GET", "/v1/datasources", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/datasources") .get() .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Delete Presto router
This will completely delete the Presto router only when there are no clusters associated with the router
DELETE /v1/prestorouters/{id}
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the presto router
curl --request DELETE --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id} --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'DELETE', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("DELETE", "/v1/prestorouters/{id}", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}") .delete(null) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
curl --request GET --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'GET', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("GET", "/v1/prestorouters", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters") .get() .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
Pick a presto router name. This is unique across the compute plane. We recommend a descriptive name to help you identity presto router. The presto router name can only contain letters, numbers, hyphens and spaces. The name must begin and end with a letter or number. It can be a maximum of 63 characters long.
The compute plane Id where the presto router is deployed.
The list of presto user Ids to attach to this router.
Possible values: number of items ≥ 1
Configuration settings for the Presto router.
Examples:{ "groups": [ { "name": "GroupA", "members": [ "https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com", "https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com" ], "weights": [ 1, 2 ] }, { "name": "GroupB", "members": [ "https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com", "https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com" ], "weights": [ 1, 2 ] } ], "selectors": [ { "targetGroup": "GroupA", "user": "user-a" }, { "targetGroup": "GroupB", "source": "presto-cli", "user": "user-b" } ], "scheduler": "WEIGHTED_ROUND_ROBIN" }
Description of the presto router.
Select the AWS EC2 instance type to be provisioned for the Presto router. We currently only support m5x.large instance type.
Specify custom tag keys and values when creating a Presto router.
Enter the Presto router count you want for the Presto router. Pick a value between 1 and 5.
Possible values: 1 ≤ value ≤ 5
Default:
1
curl --request POST --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"name":"string","description":"string","computePlaneId":"string","instanceType":"string","prestoUserIds":["string"],"customTags":{},"prestoRouterConfiguration":{"groups":[{"name":"GroupA","members":["https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com","https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com"],"weights":[1,2]},{"name":"GroupB","members":["https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com","https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com"],"weights":[1,2]}],"selectors":[{"targetGroup":"GroupA","user":"user-a"},{"targetGroup":"GroupB","source":"presto-cli","user":"user-b"}],"scheduler":"WEIGHTED_ROUND_ROBIN"},"prestoRouterCount":1}'
const request = require('request'); const options = { method: 'POST', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: { name: 'string', description: 'string', computePlaneId: 'string', instanceType: 'string', prestoUserIds: ['string'], customTags: {}, prestoRouterConfiguration: { groups: [ { name: 'GroupA', members: [ 'https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com', 'https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com' ], weights: [1, 2] }, { name: 'GroupB', members: [ 'https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com', 'https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com' ], weights: [1, 2] } ], selectors: [ {targetGroup: 'GroupA', user: 'user-a'}, {targetGroup: 'GroupB', source: 'presto-cli', user: 'user-b'} ], scheduler: 'WEIGHTED_ROUND_ROBIN' }, prestoRouterCount: 1 }, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters" payload := strings.NewReader("{\"name\":\"string\",\"description\":\"string\",\"computePlaneId\":\"string\",\"instanceType\":\"string\",\"prestoUserIds\":[\"string\"],\"customTags\":{},\"prestoRouterConfiguration\":{\"groups\":[{\"name\":\"GroupA\",\"members\":[\"https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]},{\"name\":\"GroupB\",\"members\":[\"https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]}],\"selectors\":[{\"targetGroup\":\"GroupA\",\"user\":\"user-a\"},{\"targetGroup\":\"GroupB\",\"source\":\"presto-cli\",\"user\":\"user-b\"}],\"scheduler\":\"WEIGHTED_ROUND_ROBIN\"},\"prestoRouterCount\":1}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"name\":\"string\",\"description\":\"string\",\"computePlaneId\":\"string\",\"instanceType\":\"string\",\"prestoUserIds\":[\"string\"],\"customTags\":{},\"prestoRouterConfiguration\":{\"groups\":[{\"name\":\"GroupA\",\"members\":[\"https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]},{\"name\":\"GroupB\",\"members\":[\"https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]}],\"selectors\":[{\"targetGroup\":\"GroupA\",\"user\":\"user-a\"},{\"targetGroup\":\"GroupB\",\"source\":\"presto-cli\",\"user\":\"user-b\"}],\"scheduler\":\"WEIGHTED_ROUND_ROBIN\"},\"prestoRouterCount\":1}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("POST", "/v1/prestorouters", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"name\":\"string\",\"description\":\"string\",\"computePlaneId\":\"string\",\"instanceType\":\"string\",\"prestoUserIds\":[\"string\"],\"customTags\":{},\"prestoRouterConfiguration\":{\"groups\":[{\"name\":\"GroupA\",\"members\":[\"https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]},{\"name\":\"GroupB\",\"members\":[\"https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]}],\"selectors\":[{\"targetGroup\":\"GroupA\",\"user\":\"user-a\"},{\"targetGroup\":\"GroupB\",\"source\":\"presto-cli\",\"user\":\"user-b\"}],\"scheduler\":\"WEIGHTED_ROUND_ROBIN\"},\"prestoRouterCount\":1}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters") .post(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Update Presto router count
Update the count of the Presto router
PATCH /v1/prestorouters/{id}/prestoroutercount
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the presto router
The count of Presto routers. Pick a value between 1 and 5.
Possible values: 1 ≤ value ≤ 5
curl --request PATCH --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestoroutercount --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"prestoRouterCount":1}'
const request = require('request'); const options = { method: 'PATCH', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestoroutercount', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: {prestoRouterCount: 1}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestoroutercount" payload := strings.NewReader("{\"prestoRouterCount\":1}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"prestoRouterCount\":1}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("PATCH", "/v1/prestorouters/{id}/prestoroutercount", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"prestoRouterCount\":1}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestoroutercount") .patch(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Update presto router configuration
Dynamically modify the router configuration without the need to restart the router. You can add/remove clusters, add/remove/rearrange selectors and change routing algorithm.
PUT /v1/prestorouters/{id}/prestorouterconfig
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the presto router
- Examples:
{ "groups": [ { "name": "GroupA", "members": [ "https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com", "https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com" ], "weights": [ 1, 2 ] }, { "name": "GroupB", "members": [ "https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com", "https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com" ], "weights": [ 1, 2 ] } ], "selectors": [ { "targetGroup": "GroupA", "user": "user-a" }, { "targetGroup": "GroupB", "source": "presto-cli", "user": "user-b" } ], "scheduler": "WEIGHTED_ROUND_ROBIN" }
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestorouterconfig --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"prestoRouterConfiguration":{"groups":[{"name":"GroupA","members":["https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com","https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com"],"weights":[1,2]},{"name":"GroupB","members":["https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com","https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com"],"weights":[1,2]}],"selectors":[{"targetGroup":"GroupA","user":"user-a"},{"targetGroup":"GroupB","source":"presto-cli","user":"user-b"}],"scheduler":"WEIGHTED_ROUND_ROBIN"}}'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestorouterconfig', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: { prestoRouterConfiguration: { groups: [ { name: 'GroupA', members: [ 'https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com', 'https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com' ], weights: [1, 2] }, { name: 'GroupB', members: [ 'https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com', 'https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com' ], weights: [1, 2] } ], selectors: [ {targetGroup: 'GroupA', user: 'user-a'}, {targetGroup: 'GroupB', source: 'presto-cli', user: 'user-b'} ], scheduler: 'WEIGHTED_ROUND_ROBIN' } }, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestorouterconfig" payload := strings.NewReader("{\"prestoRouterConfiguration\":{\"groups\":[{\"name\":\"GroupA\",\"members\":[\"https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]},{\"name\":\"GroupB\",\"members\":[\"https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]}],\"selectors\":[{\"targetGroup\":\"GroupA\",\"user\":\"user-a\"},{\"targetGroup\":\"GroupB\",\"source\":\"presto-cli\",\"user\":\"user-b\"}],\"scheduler\":\"WEIGHTED_ROUND_ROBIN\"}}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"prestoRouterConfiguration\":{\"groups\":[{\"name\":\"GroupA\",\"members\":[\"https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]},{\"name\":\"GroupB\",\"members\":[\"https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]}],\"selectors\":[{\"targetGroup\":\"GroupA\",\"user\":\"user-a\"},{\"targetGroup\":\"GroupB\",\"source\":\"presto-cli\",\"user\":\"user-b\"}],\"scheduler\":\"WEIGHTED_ROUND_ROBIN\"}}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("PUT", "/v1/prestorouters/{id}/prestorouterconfig", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"prestoRouterConfiguration\":{\"groups\":[{\"name\":\"GroupA\",\"members\":[\"https://<cluster1_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster2_name>.<external_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]},{\"name\":\"GroupB\",\"members\":[\"https://<cluster2_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\",\"https://<cluster3_name>.<cluster_id>.cvpc.lakehouse.cloud.ibm.com\"],\"weights\":[1,2]}],\"selectors\":[{\"targetGroup\":\"GroupA\",\"user\":\"user-a\"},{\"targetGroup\":\"GroupB\",\"source\":\"presto-cli\",\"user\":\"user-b\"}],\"scheduler\":\"WEIGHTED_ROUND_ROBIN\"}}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestorouterconfig") .put(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Update attached Presto users
Attach or detach presto users to the presto router. Please wait a couple of minutes for the credentials change to take effect.
PUT /v1/prestorouters/{id}/prestousers
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the presto router
The complete list of Presto user ids to attach to this router.
Possible values: number of items ≥ 1
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestousers --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' --header 'content-type: application/json' --data '{"prestoUserIds":["string"]}'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestousers', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN', 'content-type': 'application/json' }, body: {prestoUserIds: ['string']}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestousers" payload := strings.NewReader("{\"prestoUserIds\":[\"string\"]}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") payload = "{\"prestoUserIds\":[\"string\"]}" headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN", 'content-type': "application/json" } conn.request("PUT", "/v1/prestorouters/{id}/prestousers", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"prestoUserIds\":[\"string\"]}"); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/prestousers") .put(body) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
Restart Presto router
Trigger the Presto router restart workflow if in active state
PUT /v1/prestorouters/{id}/restart
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the presto router
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/restart --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/restart', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/restart" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("PUT", "/v1/prestorouters/{id}/restart", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/restart") .put(null) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Start Presto router
Trigger the Presto router start workflow if in inactive state
PUT /v1/prestorouters/{id}/start
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the presto router
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/start --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/start', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/start" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("PUT", "/v1/prestorouters/{id}/start", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/start") .put(null) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Stop Presto router
Trigger the Presto router stop workflow if in active state
PUT /v1/prestorouters/{id}/stop
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the presto router
curl --request PUT --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/stop --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'PUT', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/stop', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/stop" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("PUT", "/v1/prestorouters/{id}/stop", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/prestorouters/{id}/stop") .put(null) .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();
Request
Custom Headers
Instance ID
Path Parameters
The unique identifier of the compute plane
curl --request GET --url https://api.cvpc.lakehouse.cloud.ibm.com/v1/computeplanes/{id}/prestoversions --header 'AuthInstanceId: REPLACE_YOUR_CRN' --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
const request = require('request'); const options = { method: 'GET', url: 'https://api.cvpc.lakehouse.cloud.ibm.com/v1/computeplanes/{id}/prestoversions', headers: { AuthInstanceId: 'REPLACE_YOUR_CRN', Authorization: 'Bearer REPLACE_BEARER_TOKEN' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://api.cvpc.lakehouse.cloud.ibm.com/v1/computeplanes/{id}/prestoversions" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("AuthInstanceId", "REPLACE_YOUR_CRN") req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
import http.client conn = http.client.HTTPSConnection("api.cvpc.lakehouse.cloud.ibm.com") headers = { 'AuthInstanceId': "REPLACE_YOUR_CRN", 'Authorization': "Bearer REPLACE_BEARER_TOKEN" } conn.request("GET", "/v1/computeplanes/{id}/prestoversions", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.cvpc.lakehouse.cloud.ibm.com/v1/computeplanes/{id}/prestoversions") .get() .addHeader("AuthInstanceId", "REPLACE_YOUR_CRN") .addHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN") .build(); Response response = client.newCall(request).execute();