设置配置属性
名称
sco config set - 设置配置属性
说明
sco config set <section.property> <value> [flags]
描述
设置当前 active profile 中指定配置键的值。Region-bound 配置会写入当前 active Region。
使用说明
- 设置
subscription、resource_group、zone、vpc_id前需要已有 active Region。 - 设置
resource_group前需要先配置subscription;设置aec2.resource_group等产品级资源组前,需要先配置对应的aec2.subscription等产品级订阅。 zone不允许设置为空;建议使用sco zones use <zone>切换可用区。region可使用 Region code 或唯一 Region 名称;建议使用sco regions use <region>切换。
命令行参数
<section.property>:配置键。<value>:配置值。
命令行标志
无命令专属标志。
示例
设置默认订阅:
sco config set subscription default
设置默认资源组:
sco config set resource_group default
设置返回内容语言:
sco config set accept_language zh-CN
全局标志
以下全局标志适用于所有 sco 命令:
--help:查看帮助信息。--profile <profile>:指定本次命令使用的 profile。--debug:输出调试日志。--subscription <subscription>:指定本次请求使用的订阅。--resource-group <resource-group>:指定本次请求使用的资源组。--region <region>:指定本次请求使用的 Region。--color <no|auto>:设置输出颜色模式。
支持的配置键
| 配置键 | 说明 | 存储范围 |
|---|---|---|
access_key_id | AccessKey ID | profile |
access_key_secret | AccessKey Secret | profile |
accept_language | 返回内容语言,支持 zh-CN、en-US | profile |
region | 当前 active Region | profile default |
subscription | 默认订阅 | 当前 active Region |
resource_group | 默认资源组 | 当前 active Region |
zone | 当前可用区 | 当前 active Region |
vpc_id | 默认 VPC ID | 当前 active Region |
aec2.subscription | AEC2 默认订阅 | 当前 active Region |
aec2.resource_group | AEC2 默认资源组 | 当前 active Region |
ws.subscription | WS 默认订阅 | 当前 active Region |
ws.resource_group | WS 默认资源组 | 当前 active Region |
ecp.subscription | ECP 默认订阅 | 当前 active Region |
ecp.resource_group | ECP 默认资源组 | 当前 active Region |
ecp.region | ECP 默认 Region | 当前 active Region |
ecp.zone | ECP 默认可用区 | 当前 active Region |