IBM Cloud Docs
Configuring account settings

Configuring account settings

You can configure your account settings for IBM Cloud® Metrics Routing by using the IBM Cloud Metrics Routing CLI, the IBM Cloud Metrics Routing REST API, and Terraform scripts. Set these settings to define where and how metrics are collected, routed, and managed in your account.

When you configure or modify the IBM Cloud Metrics Routing account settings, consider the following information:

  • Before you disable public endpoints by setting --private-api-endpoint-only TRUE, make sure your account has access to the private endpoint. You can do this by running the command ibmcloud account show. If VRF Enabled is true and Service Endpoint Enabled is true then you have access to the private endpoint. If you do not have access to the private endpoint, you will be unable to re-enable the public endpoint since private endpoint access is required to re-enable the public endpoint.

For more information, see About account settings.

IAM permissions

Ensure you have the correct IAM permissions to configure IBM Cloud Metrics Routing settings.

CLI prerequisites

Before you use the the CLI to manage IBM Cloud Metrics Routing account settings, Install the IBM Cloud Metrics Routing CLI.

Check that you have IAM permissions to read, update, or both the IBM Cloud Metrics Routing account settings.

Getting account settings using the CLI

Use this command to get the settings for the IBM Cloud Metrics Routing account configurations.

ibmcloud metrics-router setting get [--output FORMAT]

Command options

--output FORMAT
If JSON is specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.

Example

The following is an example where no default or permitted targets have been set.

Primary metadata region:             us-east
Backup metadata region:              -
Default targets:                     []
Permitted target regions:            []
Private api endpoint only:           false

Updating settings using the CLI

Use this command to modify current account settings such as the default targets, permitted target regions, and the primary metadata region.

ibmcloud metrics-router setting update [--primary-metadata-region REGION] [--backup-metadata-region REGION] [--private-api-endpoint-only ( TRUE | FALSE )] [--default-targets TARGET] [--permitted-target-regions REGIONS] [--output FORMAT] [--force]

Command options

primary-metadata-region
Specify the REGION where the metadata associated with route and target definitions is stored.
backup-metadata-region
Specify the REGION where the metadata associated with route and target definitions is stored as a backup.
private-api-endpoint-only
Specifies whether nor not a private endpoint can be used. If TRUE only a private endpoint can be used.
default-targets
Is a list of target IDs. If no routing rules cause metrics to be sent to other targets, these targets will received the metrics. TARGETS is a comma-separated list of target IDs.
permitted-target-regions
Is the list of regions that can be used to define a target. REGIONS is a comma-separated list of regions.
--output FORMAT
If JSON specified, output will be returned in JSON format. If JSON is not specified, output will be returned in a tabular format.
help | --help | -h
List options available for the command.

If the update is successful, the current settings will be displayed.

API prerequsites

To make API calls to manage settings, complete the following steps:

  1. Get an IAM access token. For more information, see Retrieving IAM access tokens.
  2. Identify the API endpoint in the region where you plan to configure or manage settings. For more information, see Endpoints.

Getting settings using the API

You can use the following cURL command to get existing settings information:

curl -X GET  ENDPOINT/api/v3/settings   -H "Authorization:  $ACCESS_TOKEN"

Where:

ENDPOINT
Is the API endpoint in the region where you plan to configure or manage a target. For more information, see Endpoints.

For example, you can use the following cURL request to get the account settings information:

curl -X GET   https://private.us-south.metrics_router.cloud.ibm.com/api/v2/settings   -H "Authorization:  $ACCESS_TOKEN"

A response similar to the following is returned:


{
  "default_targets": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "crn": "crn:v1:bluemix:public:metrics-router:us-south:a/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa::target:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "name": "default-us-south-target",
      "target_type": "sysdig_monitor"
    },
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "crn": "crn:v1:bluemix:public:metrics-router:au-syd:a/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa::target:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "name": "default-au-syd-south-target",
      "target_type": "sysdig_monitor"
    }
  ],
  "permitted_target_regions": [
    "us-south",
    "us-east"
  ],
  "primary_metadata_region": "us-south",
  "private_api_endpoint_only": false
}

Where:

default_targets
Is a list of target IDs. If no routing rules cause metrics to be sent to other targets, these targets will received the metrics.
permitted_target_regions
Is the list of regions that can be used to define a target. A maximum of two permitted target regions are allowed.
primary_metadata_region
Is the region where the metadata associated with route and target definitions is stored.
backup_metadata_region
Is the region where the metadata associated with route and target definitions is stored as a backup.
private_api_endpoint_only
Specifies whether nor not a private endpoint can be used. If true only a private endpoint can be used.

Updating settings using the API

When you update settings, consider the following information:

  • You must include the settings information in the data section of the request.

  • You must pass the data that is configured for each setting.

    Data that is configured and not included in an update request is deleted.

  • Update the data for the fields that need changing.

You can use the following cURL command to update settings:

curl -X PATCH   https://<ENDPOINT>/api/v3/settings
-H "Authorization: Bearer <IAM_TOKEN>"
-H 'accept: application/json'
-d '{
  "default_targets": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  ],
  "permitted_target_regions": ["us-south", "us-east"],
  "primary_metadata_region": "us-south",
  "backup_metadata_region": "us-east",
  "private_api_endpoint_only": false
}'

Where:

ENDPOINT
Is the API endpoint in the region where you plan to configure or manage a target. For more information, see Endpoints.
default_targets
Is a list of target IDs. If no routing rules cause metrics to be sent to other targets, these targets will received the metrics.
permitted_target_regions
Is the list of regions that can be used to define a target. A maximum of two permitted target regions can be specified.
primary_metadata_region
Is the region where the metadata associated with route and target definitions is stored.
backup_metadata_region
Is the region where the metadata associated with route and target definitions is stored for backup purposes.
private_api_endpoint_only
Specifies whether or not a private endpoint can be used. If true only a private endpoint can be used.