Skip to content

Configuration Manual for Collector "Huawei Cloud-DCS"

Before reading this, please first read:

Before using this collector, you must install the 'Integration Core Package' and its corresponding third-party dependency packages

1. Configuration Structure

The configuration structure of this collector is as follows:

Configuration One (Recommended)

Field Type Required Description
regions list Required List of regions to collect data from
regions[#] str Required Region ID. For example: 'cn-north-4'
See appendix for full list

The collector will automatically retrieve all IAM projects under the region, then obtain resources based on IAM projects

Configuration Two (Old Version Compatibility)

Field Type Required Description
region_projects dict Required List of 'Region - Project ID' pairs for required data collection
region_projects[#] str:list Required Key-value pair where:
Key represents the region (e.g., 'cn-north-4')
Value represents the list of project IDs to be collected in that region
See appendix for full list

2. Configuration Example

Specify Region

Collect Dcs instance data for projects in the cn-north-4 region.

Python
1
2
3
collector_configs = {
    'regions': ['cn-north-4']
}

Configure Filters (Optional)

This collector script supports user-defined filters, allowing users to filter target resources by object properties. The filter function returns True|False

  • True: Target resource needs to be collected.

  • False: Target resource does not need to be collected.

Supported object properties for filtering:

Property Description
instance_id Instance ID
engine Instance Engine
port Port
ip IP Address
Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Example: Enable filter, filter instances based on the instance_id property of the instance object, configuration format as follows:
def filter_instance(instance):
    '''
    Collect instances with instance_id xxxx
    '''
    instance_id = instance.get('instance_id')
    if instance_id in ['xxx']:
        return True
    return False


###### Do not modify the following contents #####
from guance_integration__runner import Runner
import guance_huaweicloud_dcs__main as main


@DFF.API('HuaweiCloud-DCS Collection', timeout=3600, fixed_crontab='*/15 * * * *')
def run():
    Runner(main.DataCollector(account, collector_configs, filters=[filter_instance])).run()

3. Data Reporting Format

After data synchronization is normal, you can view the data in the 'Infrastructure-Resource Catalog' section of {{( brand_name }}}.

Example of reported data:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "measurement": "huaweicloud_redis",
  "tags": {
    "RegionId"             : "cn-north-4",
    "project_id"           : "c631f04625xxxxxxxxxxf253c62d48585",
    "enterprise_project_id": "0",
    "name"                 : "71be0037-xxxx-xxxx-xxxx-b6b91f134066",
    "instance_id"          : "71be0037-xxxx-xxxx-xxxx-b6b91f134066",
    "instance_name"        : "dcs-iash",
    "engine"               : "Redis"
  },
  "fields": {
    "engine_version"       : "5.0",
    "status"               : "RUNNING",
    "az_codes"             : "[\"cn-north-4c\", \"cn-north-4a\"]",
    "port"                 : "6379",
    "ip"                   : "192.xxx.x.144",
    "charging_mode"        : "0",
    "no_password_access"   : "true",
    "enable_publicip"      : "False",
    "created_at"           : "2022-07-12T07:29:56.875Z",
    "max_memory"           : 128,
    "used_memory"          : 2,
    "capacity"             : 0,
    "description"          : "",
    "message"              : "{Instance JSON data}"
  }
}

Explanation of some fields:

Field Type Description
ip String IP address used to connect to the cache instance. If it's a cluster instance, multiple IP addresses are returned, separated by commas. For example: 192.168.0.1, 192.168.0.2.
charging_mode String Billing mode, 0 indicates pay-as-you-go billing, 1 indicates annual/monthly billing.
no_password_access String Whether password-free access to the cache instance is allowed:
true: This instance can be accessed without a password.
false: This instance must be authenticated with a password to access.
enable_publicip String Whether the Redis cache instance has public network access enabled
True: Enabled
False: Not enabled
max_memory Integer Total memory, unit: MB.
used_memory Integer Used memory, unit: MB.
capacity Integer Cache capacity (G Byte).
status String CREATING: After applying for a cache instance, the status before the cache instance enters the running state.
CREATEFAILED: The cache instance is in a failed creation state.
RUNNING: The cache instance is in normal operation.
RESTARTING: The cache instance is undergoing a restart operation.
FROZEN: The cache instance is in a frozen state, users can renew and unfreeze the cache instance in "My Orders".
EXTENDING: The cache instance is in an expansion state.
RESTORING: The cache instance data is in a recovery state.
FLUSHING: The cache instance data is in a clearing state.

Fields in tags and fields may change with subsequent updates

The value of tags.name is the instance ID, used as a unique identifier

The following fields are serialized JSON strings

  • fields.message
  • tags.az_codes

X. Appendix

Huawei Cloud Dcs "Region ID"

Refer to the official Huawei Cloud documentation: