huaweicloud/huaweicloud-skills

huawei-cloud-lts-manage

Huawei Cloud LTS (Log Tank Service) full lifecycle management via hcloud CLI.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/huaweicloud/huaweicloud-skills --skill huawei-cloud-lts-manage

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Huawei Cloud LTS Log Service Management

Overview

This skill manages Huawei Cloud LTS (Log Tank Service / 云日志服务) resources through hcloud CLI. It covers the full lifecycle of log groups, log streams, indexes, transfer tasks, and alarm rules, plus log search for fault diagnosis and security event response.

Capabilities:

CategoryOperations
QueryList log groups, log streams, indexes, transfers, alarm rules, alarm history; search logs (keyword, structured, context, histogram)
CreateCreate log groups, log streams, full-text indexes, OBS transfer tasks, keyword alarm rules, SQL alarm rules
UpdateUpdate log group TTL, log stream TTL/storage, transfer config, alarm rules, alarm status, struct config
DeleteDelete log groups, log streams, transfers, alarm rules (⚠️ requires confirmation)
DiagnoseSearch logs by keyword/time to locate faults; query log context; view log distribution histogram

Prerequisites

  1. hcloud CLI installed and authenticated — see references/cli-installation-guide.md
  2. Huawei Cloud AK/SK configured via hcloud configure (CLI profile)
  3. IAM permissions — see references/iam-policies.md for least-privilege policy
  4. Region: LTS is region-specific. Use --cli-region to specify the target region (e.g., cn-north-4, ap-southeast-1)

Workflow

1. Identify target log group/stream (ListLogGroups → ListLogStreams)
2. Query or manage resources based on user intent:
   ├── Query: list/show logs, indexes, transfers, alarms
   ├── Create: create log group/stream/index/transfer/alarm
   ├── Update: modify TTL/index/transfer/alarm config
   ├── Delete: remove resources (⚠️ confirmation required)
   └── Diagnose: search logs with keywords/time range
3. Return results (query returns JSON; mutations return resource config snapshot)

Core Commands

Query — Log Groups & Streams

bash
# List all log groups
hcloud LTS ListLogGroups --cli-region={region} --project_id={project_id}

# List log streams under a group
hcloud LTS ListLogStreams --cli-region={region} --project_id={project_id} \
  --log_group_name={log_group_name}

# Query index configuration for a log stream
hcloud LTS ListLogStreamIndex --cli-region={region} --project_id={project_id} \
  --group_id={group_id} --stream_id={stream_id}

Query — Transfer Tasks

bash
# List all transfer tasks
hcloud LTS ListTransfers --cli-region={region} --project_id={project_id}

# Filter by transfer type (OBS/DIS/DMS)
hcloud LTS ListTransfers --cli-region={region} --project_id={project_id} \
  --log_transfer_type=OBS

Query — Alarm Rules & History

bash
# List keyword alarm rules
hcloud LTS ListKeywordsAlarmRules --cli-region={region} --project_id={project_id}

# List SQL alarm rules
hcloud LTS ListSqlAlarmRules --cli-region={region} --project_id={project_id}

# Query active or history alarms (type: active_alert/history_alert)
# --whether_custom_field=false requires --time_range (minutes); true requires --start_time/--end_time (ms)
hcloud LTS ListActiveOrHistoryAlarms --cli-region={region} --project_id={project_id} \
  --domain_id={domain_id} --type=history_alert --whether_custom_field=false --time_range=30 --limit=10

Query — Log Search (Diagnose)

bash
# Search logs by keyword and time range
hcloud LTS ListLogs --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id} --log_stream_id={log_stream_id} \
  --start_time={start_time} --end_time={end_time} \
  --keywords="ERROR" --limit=50 --is_desc=true --highlight=true

# Get log context around a specific line (for fault diagnosis)
hcloud LTS ListLogContext --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id} --log_stream_id={log_stream_id} \
  --__time__={timestamp} --line_num={line_num} \
  --backwards_size=10 --forwards_size=10

# Get log distribution histogram (for trend analysis)
hcloud LTS ListLogHistogram --cli-region={region} --project_id={project_id} \
  --group_id={group_id} --stream_id={stream_id} \
  --start_time={start_time} --end_time={end_time} \
  --key_word="ERROR" --step_interval=3600000

# Query structured logs with SQL expression (requires the log stream to have a struct config)
# Supported SQL: GROUP BY / LIKE / WHERE
hcloud LTS ListQueryStructuredLogs --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id} --log_stream_id={log_stream_id} \
  --start_time={start_time} --end_time={end_time} \
  --sql_expression="select * where level like '%ERROR%'"

Create — Log Groups & Streams

bash
# Create a log group with TTL (days)
hcloud LTS CreateLogGroup --cli-region={region} --project_id={project_id} \
  --log_group_name="my-log-group" --ttl_in_days=30

# Create a log stream under a group
hcloud LTS CreateLogStream --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id} --log_stream_name="my-log-stream" --ttl_in_days=30

Create — Index

bash
# Create full-text index for a log stream
hcloud LTS CreateLogStreamIndex --cli-region={region} --project_id={project_id} \
  --group_id={group_id} --stream_id={stream_id} --logStreamId={stream_id} \
  --fullTextIndex.enable=true --fullTextIndex.caseSensitive=false \
  --fullTextIndex.includeChinese=true --fullTextIndex.tokenizer=" "

Create — Transfer Task (to OBS)

bash
# Create a transfer task to OBS bucket
hcloud LTS CreateTransfer --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id} \
  --log_streams.1.log_stream_id={stream_id} --log_streams.1.log_stream_name={stream_name} \
  --log_transfer_info.log_transfer_type=OBS \
  --log_transfer_info.log_transfer_mode=cycle \
  --log_transfer_info.log_storage_format=RAW \
  --log_transfer_info.log_transfer_status=ENABLE \
  --log_transfer_info.log_transfer_detail.obs_bucket_name={bucket_name} \
  --log_transfer_info.log_transfer_detail.obs_period=5 \
  --log_transfer_info.log_transfer_detail.obs_period_unit=min

Create — Alarm Rules

bash
# Create a keyword alarm rule
hcloud LTS CreateKeywordsAlarmRule --cli-region={region} --project_id={project_id} \
  --domain_id={domain_id} \
  --keywords_alarm_rule_name="error-alarm" \
  --keywords_alarm_level=Critical \
  --keywords_requests.1.log_group_id={group_id} \
  --keywords_requests.1.log_stream_id={stream_id} \
  --keywords_requests.1.keywords="ERROR" \
  --keywords_requests.1.condition=">=" --keywords_requests.1.number=1 \
  --keywords_requests.1.search_time_range=5 --keywords_requests.1.search_time_range_unit=minute \
  --frequency.type=CRON --frequency.cron_expr="0 */5 * * * *" --notification_frequency=5

# Create a SQL alarm rule (requires sql_requests.[N].search_time_range)
hcloud LTS CreateSqlAlarmRule --cli-region={region} --project_id={project_id} \
  --domain_id={domain_id} \
  --sql_alarm_rule_name="sql-error-alarm" \
  --sql_alarm_level=Major \
  --sql_requests.1.log_group_id={group_id} \
  --sql_requests.1.log_stream_id={stream_id} \
  --sql_requests.1.sql="select count(*) where level='ERROR'" \
  --sql_requests.1.search_time_range=5 --sql_requests.1.search_time_range_unit=minute \
  --condition_expression=">=1" \
  --frequency.type=CRON --frequency.cron_expr="0 */5 * * * *" --notification_frequency=5

Update — TTL & Config

bash
# Update log group TTL (save duration)
hcloud LTS UpdateLogGroup --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id} --ttl_in_days=60

# Update log stream TTL and storage
hcloud LTS UpdateLogStream --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id} --log_stream_id={log_stream_id} \
  --ttl_in_days=60 --whether_log_storage=true

# Update transfer task config
hcloud LTS UpdateTransfer --cli-region={region} --project_id={project_id} \
  --log_transfer_id={transfer_id} \
  --log_transfer_info.log_storage_format=RAW \
  --log_transfer_info.log_transfer_status=ENABLE \
  --log_transfer_info.log_transfer_detail.obs_bucket_name={bucket_name} \
  --log_transfer_info.log_transfer_detail.obs_period=5 \
  --log_transfer_info.log_transfer_detail.obs_period_unit=min

# Enable/disable an alarm rule (status: RUNNING/STOPPING; type: keywords/sql)
hcloud LTS UpdateAlarmRuleStatus --cli-region={region} --project_id={project_id} \
  --alarm_rule_id={alarm_rule_id} --status=STOPPING --type=keywords

Delete — ⚠️ Requires Confirmation

CRITICAL: All Delete operations require explicit user confirmation before execution. Batch deletion of all LTS resources is prohibited. Each delete must specify a single resource ID.
bash
# Delete a log group (⚠️ cascades all log streams under it)
hcloud LTS DeleteLogGroup --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id}

# Delete a log stream
hcloud LTS DeleteLogStream --cli-region={region} --project_id={project_id} \
  --log_group_id={log_group_id} --log_stream_id={log_stream_id}

# Delete a transfer task
hcloud LTS DeleteTransfer --cli-region={region} --project_id={project_id} \
  --log_transfer_id={transfer_id}

# Delete a keyword alarm rule
hcloud LTS DeleteKeywordsAlarmRule --cli-region={region} --project_id={project_id} \
  --keywords_alarm_rule_id={alarm_rule_id}

# Delete a SQL alarm rule
hcloud LTS DeleteSqlAlarmRule --cli-region={region} --project_id={project_id} \
  --sql_alarm_rule_id={alarm_rule_id}

Parameter Confirmation

ParameterRequiredDescriptionExample
--cli-regionYesTarget region{your-region}
--project_idYesProject IDObtained from IAM console
--log_group_idFor stream/index/transfer opsLog group IDxxx-xxx-xxx
--log_stream_idFor index/log search opsLog stream IDxxx-xxx-xxx
--ttl_in_daysFor create/update group/streamLog retention in days30, 60, 365
--keywordsFor log searchSearch keywords"ERROR", "Exception"
--start_time / --end_timeFor log searchTime range (ms)1700000000000
--log_transfer_typeFor transfer filterTransfer typeOBS, DIS, DMS

Delete Safety Rules

  1. Single resource deletion only — each Delete call must specify exactly one resource ID
  2. No wildcard/batch delete — DeleteLogGroup deletes all streams under the group; always confirm the cascade impact
  3. User must explicitly confirm — reply "确认" / "confirm" / "ok" before any Delete execution
  4. Prohibited: deleting all log groups or all alarm rules in a single session without individual confirmation

Reference Documents

KooCLI Command Format Standard

bash
hcloud LTS ListLogGroups --cli-region={your-region} [--key=value ...]
FeatureDescriptionExample
Service nameLTS (uppercase)hcloud LTS ListLogGroups
Operation namePascalCaseListLogGroups, CreateTransfer, DeleteLogStream
Region parameter--cli-region=<value>--cli-region={your-region}
Simple parameter--key=value--log_group_name=my-group
Indexed parameter--key.1=value--keywords_requests.1.keywords=ERROR

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
huaweicloud
커뮤니티

huawei-cloud-devbridge-tunnel

Create and manage DevBridge development tunnels on Huawei Cloud to securely expose local development services to remote devices. Based on DevBridge CLI v0.2.x and API Key authentication. Use this skill when the user wants to: (1) install and configure the DevBridge CLI, (2) create/list/update/delete tunnels, (3) manage tunnel ports and protocols, (4) host local services through tunnels, (5) connect to remote tunnels from another device, (6) manage authentication and API Keys. Trigger: user menti

1시간 설치 수
3
GitHub Stars
59
업데이트
11월 20일
huaweicloud
커뮤니티

huawei-cloud-find-skills

Invoke this skill to search, list, query, discover, browse, find and install any Huawei Cloud (华为云) agent skill. Triggers include: "华为云", "华为云有什么skill", "华为云相关skill", "华为云agent skill 市场", "华为云skill类目", "explore Huawei Cloud skills", "show Huawei Cloud skill categories", "does a Huawei Cloud skill exist for...", "which Huawei Cloud skills exist", "搜索华为云技能", "查询华为云skill列表", "有没有管理ECS/OBS/RDS的skill", "帮我找 XX 华为云skill", "介绍 XX Skill 内容", "华为云 XX Skill 具体做什么", "安装华为云Skill".

1시간 설치 수
3
GitHub Stars
59
업데이트
11월 20일
huaweicloud
커뮤니티

huawei-cloud-terraform-installer

Installs Terraform CLI cross-platform with Huawei Cloud mirror support. Use this skill whenever the user mentions installing Terraform, setting up Terraform environment, or when IaC tasks detect missing Terraform. Trigger: install terraform, setup terraform, terraform environment, huaweicloud provider.

1시간 설치 수
6
GitHub Stars
59
업데이트
11월 7일
huaweicloud
커뮤니티

huawei-cloud-billing-scout

Huawei Cloud BSS billing (not AWS/Azure/other clouds; refuses pricing quotes, real-name review, and any non-billing scope): balance, spend, attribution, reconciliation, coupons, stored-value cards, enterprise/partner billing. One-page briefing via hcloud. Use when the request is about Huawei Cloud billing. Triggers include: 华为云余额, 华为云欠费, 华为云本月花费, 华为云扣费原因, 华为云账单对账, 华为云资源包, 华为云优惠券, 华为云企业主账号, 华为云伙伴账务, 华为云服务编码, Huawei Cloud balance / bill / spend / reconciliation / coupon / stored-value card / BSS b

1시간 설치 수
5
GitHub Stars
59
업데이트
11월 7일