查询当前站点支持的商品清单 - ListSubscriptionProduct
功能介绍
查询当前站点SecMaster支持的商品清单
调用方法
请参见如何调用API。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
GET /v1/{project_id}/subscriptions/products
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
租户projectId |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
|
X-Language |
是 |
String |
用户当前语言环境, zh-cn简体中文,en-us英文环境 |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
basic |
basic object |
基础版商品编码对象 |
|
standard |
standard object |
标准版商品编码对象 |
|
professional |
professional object |
专业版商品编码对象 |
|
large_screen |
large_screen object |
安全大屏商品编码对象 |
|
log_collection |
log_collection object |
日志采集商品编码对象 |
|
log_retention |
log_retention object |
日志保留商品编码对象 |
|
log_analysis |
log_analysis object |
日志分析商品编码对象 |
|
soar |
soar object |
安全编排商品编码对象 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
cloud_service_type |
String |
云服务产品的主服务类型,云脑默认为:xxx.service.type.sa |
|
resource_type |
String |
资源类型编码 |
|
resource_spec_code |
String |
资源规格编码 |
|
resource_size_measure_id |
Integer |
资源容量度量标识 |
|
usage_factor |
String |
使用量因子,按需计费必填,取值和话单中的使用量因子一致,云服务和使用量因子对应关系如下: 云脑目前支持有: duration: 时间,主要针对主版本(basic、standard、professional) count:次数,主要针对安全编排 flow:流量,主要针对日志分析和采集 retention:保留,主要针对日志保留 |
|
usage_measure_id |
Integer |
使用量单位标识,按需询价必填,例如按小时询价,使用量值为1,使用量单位为小时,枚举值如下: 4:小时 10:GB(带宽按流量询价使用) 11:MB(带宽按流量询价使用) 13:Byte(带宽按流量询价使用) |
|
region_id |
String |
当前region编码,默认为null,即为当前region |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
cloud_service_type |
String |
云服务产品的主服务类型,云脑默认为:xxx.service.type.sa |
|
resource_type |
String |
资源类型编码 |
|
resource_spec_code |
String |
资源规格编码 |
|
resource_size_measure_id |
Integer |
资源容量度量标识 |
|
usage_factor |
String |
使用量因子,按需计费必填,取值和话单中的使用量因子一致,云服务和使用量因子对应关系如下: 云脑目前支持有: duration: 时间,主要针对主版本(basic、standard、professional) count:次数,主要针对安全编排 flow:流量,主要针对日志分析和采集 retention:保留,主要针对日志保留 |
|
usage_measure_id |
Integer |
使用量单位标识,按需询价必填,例如按小时询价,使用量值为1,使用量单位为小时,枚举值如下: 4:小时 10:GB(带宽按流量询价使用) 11:MB(带宽按流量询价使用) 13:Byte(带宽按流量询价使用) |
|
region_id |
String |
当前region编码,默认为null,即为当前region |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
cloud_service_type |
String |
云服务产品的主服务类型,云脑默认为:xxx.service.type.sa |
|
resource_type |
String |
资源类型编码 |
|
resource_spec_code |
String |
资源规格编码 |
|
resource_size_measure_id |
Integer |
资源容量度量标识 |
|
usage_factor |
String |
使用量因子,按需计费必填,取值和话单中的使用量因子一致,云服务和使用量因子对应关系如下: 云脑目前支持有: duration: 时间,主要针对主版本(basic、standard、professional) count:次数,主要针对安全编排 flow:流量,主要针对日志分析和采集 retention:保留,主要针对日志保留 |
|
usage_measure_id |
Integer |
使用量单位标识,按需询价必填,例如按小时询价,使用量值为1,使用量单位为小时,枚举值如下: 4:小时 10:GB(带宽按流量询价使用) 11:MB(带宽按流量询价使用) 13:Byte(带宽按流量询价使用) |
|
region_id |
String |
当前region编码,默认为null,即为当前region |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
cloud_service_type |
String |
云服务产品的主服务类型,云脑默认为:xxx.service.type.sa |
|
resource_type |
String |
资源类型编码 |
|
resource_spec_code |
String |
资源规格编码 |
|
resource_size_measure_id |
Integer |
资源容量度量标识 |
|
usage_factor |
String |
使用量因子,按需计费必填,取值和话单中的使用量因子一致,云服务和使用量因子对应关系如下: 云脑目前支持有: duration: 时间,主要针对主版本(basic、standard、professional) count:次数,主要针对安全编排 flow:流量,主要针对日志分析和采集 retention:保留,主要针对日志保留 |
|
usage_measure_id |
Integer |
使用量单位标识,按需询价必填,例如按小时询价,使用量值为1,使用量单位为小时,枚举值如下: 4:小时 10:GB(带宽按流量询价使用) 11:MB(带宽按流量询价使用) 13:Byte(带宽按流量询价使用) |
|
region_id |
String |
当前region编码,默认为null,即为当前region |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
cloud_service_type |
String |
云服务产品的主服务类型,云脑默认为:xxx.service.type.sa |
|
resource_type |
String |
资源类型编码 |
|
resource_spec_code |
String |
资源规格编码 |
|
resource_size_measure_id |
Integer |
资源容量度量标识 |
|
usage_factor |
String |
使用量因子,按需计费必填,取值和话单中的使用量因子一致,云服务和使用量因子对应关系如下: 云脑目前支持有: duration: 时间,主要针对主版本(basic、standard、professional) count:次数,主要针对安全编排 flow:流量,主要针对日志分析和采集 retention:保留,主要针对日志保留 |
|
usage_measure_id |
Integer |
使用量单位标识,按需询价必填,例如按小时询价,使用量值为1,使用量单位为小时,枚举值如下: 4:小时 10:GB(带宽按流量询价使用) 11:MB(带宽按流量询价使用) 13:Byte(带宽按流量询价使用) |
|
region_id |
String |
当前region编码,默认为null,即为当前region |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
cloud_service_type |
String |
云服务产品的主服务类型,云脑默认为:xxx.service.type.sa |
|
resource_type |
String |
资源类型编码 |
|
resource_spec_code |
String |
资源规格编码 |
|
resource_size_measure_id |
Integer |
资源容量度量标识 |
|
usage_factor |
String |
使用量因子,按需计费必填,取值和话单中的使用量因子一致,云服务和使用量因子对应关系如下: 云脑目前支持有: duration: 时间,主要针对主版本(basic、standard、professional) count:次数,主要针对安全编排 flow:流量,主要针对日志分析和采集 retention:保留,主要针对日志保留 |
|
usage_measure_id |
Integer |
使用量单位标识,按需询价必填,例如按小时询价,使用量值为1,使用量单位为小时,枚举值如下: 4:小时 10:GB(带宽按流量询价使用) 11:MB(带宽按流量询价使用) 13:Byte(带宽按流量询价使用) |
|
region_id |
String |
当前region编码,默认为null,即为当前region |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
cloud_service_type |
String |
云服务产品的主服务类型,云脑默认为:xxx.service.type.sa |
|
resource_type |
String |
资源类型编码 |
|
resource_spec_code |
String |
资源规格编码 |
|
resource_size_measure_id |
Integer |
资源容量度量标识 |
|
usage_factor |
String |
使用量因子,按需计费必填,取值和话单中的使用量因子一致,云服务和使用量因子对应关系如下: 云脑目前支持有: duration: 时间,主要针对主版本(basic、standard、professional) count:次数,主要针对安全编排 flow:流量,主要针对日志分析和采集 retention:保留,主要针对日志保留 |
|
usage_measure_id |
Integer |
使用量单位标识,按需询价必填,例如按小时询价,使用量值为1,使用量单位为小时,枚举值如下: 4:小时 10:GB(带宽按流量询价使用) 11:MB(带宽按流量询价使用) 13:Byte(带宽按流量询价使用) |
|
region_id |
String |
当前region编码,默认为null,即为当前region |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
cloud_service_type |
String |
云服务产品的主服务类型,云脑默认为:xxx.service.type.sa |
|
resource_type |
String |
资源类型编码 |
|
resource_spec_code |
String |
资源规格编码 |
|
resource_size_measure_id |
Integer |
资源容量度量标识 |
|
usage_factor |
String |
使用量因子,按需计费必填,取值和话单中的使用量因子一致,云服务和使用量因子对应关系如下: 云脑目前支持有: duration: 时间,主要针对主版本(basic、standard、professional) count:次数,主要针对安全编排 flow:流量,主要针对日志分析和采集 retention:保留,主要针对日志保留 |
|
usage_measure_id |
Integer |
使用量单位标识,按需询价必填,例如按小时询价,使用量值为1,使用量单位为小时,枚举值如下: 4:小时 10:GB(带宽按流量询价使用) 11:MB(带宽按流量询价使用) 13:Byte(带宽按流量询价使用) |
|
region_id |
String |
当前region编码,默认为null,即为当前region |
状态码:400
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
参数解释: 错误码 取值范围: 不涉及 |
|
error_msg |
String |
参数解释: 错误描述 取值范围: 不涉及 |
状态码:403
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
参数解释: 错误码 取值范围: 不涉及 |
|
error_msg |
String |
参数解释: 错误描述 取值范围: 不涉及 |
状态码:500
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
参数解释: 错误码 取值范围: 不涉及 |
|
error_msg |
String |
参数解释: 错误描述 取值范围: 不涉及 |
请求示例
返回可用商品列表
GET https://{endpoint}/v1/{projectId}/subscriptions/products
响应示例
状态码:200
当前站点SecMaster支持的商品清单
{
"basic" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.typical",
"resource_spec_code" : "secmaster.basic",
"resource_size_measure_id" : 14,
"usage_factor" : "duration",
"usage_measure_id" : 4,
"region_id" : "demo-region"
},
"standard" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.typical",
"resource_spec_code" : "secmaster.standard",
"resource_size_measure_id" : 14,
"usage_factor" : "duration",
"usage_measure_id" : 4,
"region_id" : "demo-region"
},
"professional" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.typical",
"resource_spec_code" : "secmaster.professional",
"resource_size_measure_id" : 14,
"usage_factor" : "duration",
"usage_measure_id" : 4,
"region_id" : "demo-region"
},
"large_screen" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.cspm",
"resource_spec_code" : "cspm.largescreen",
"resource_size_measure_id" : 14,
"usage_factor" : "duration",
"usage_measure_id" : 4,
"region_id" : "demo-region"
},
"log_collection" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.siem",
"resource_spec_code" : "secmaster.basic",
"resource_size_measure_id" : 10,
"usage_factor" : "flow",
"usage_measure_id" : 10,
"region_id" : "demo-region"
},
"log_retention" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.siem",
"resource_spec_code" : "secmaster.basic",
"resource_size_measure_id" : 17,
"usage_factor" : "retention",
"usage_measure_id" : 17,
"region_id" : "demo-region"
},
"log_analysis" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.siem",
"resource_spec_code" : "secmaster.basic",
"resource_size_measure_id" : 10,
"usage_factor" : "flow",
"usage_measure_id" : 10,
"region_id" : "demo-region"
},
"soar" : {
"cloud_service_type" : "xxx.service.type.sa",
"resource_type" : "xxx.resource.type.secmaster.soar",
"resource_spec_code" : "soar.action",
"resource_size_measure_id" : 14,
"usage_factor" : "count",
"usage_measure_id" : 14,
"region_id" : "demo-region"
}
}
SDK代码示例
SDK代码示例如下。
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.secmaster.v1.region.SecMasterRegion; import com.huaweicloud.sdk.secmaster.v1.*; import com.huaweicloud.sdk.secmaster.v1.model.*; public class ListSubscriptionProductSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); SecMasterClient client = SecMasterClient.newBuilder() .withCredential(auth) .withRegion(SecMasterRegion.valueOf("<YOUR REGION>")) .build(); ListSubscriptionProductRequest request = new ListSubscriptionProductRequest(); try { ListSubscriptionProductResponse response = client.listSubscriptionProduct(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
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 29 30 31 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdksecmaster.v1.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.v1 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListSubscriptionProductRequest() response = client.list_subscription_product(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
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 29 30 31 32 33 34 35 36 37 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListSubscriptionProductRequest{} response, err := client.ListSubscriptionProduct(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
当前站点SecMaster支持的商品清单 |
|
400 |
参数异常 |
|
403 |
无权限访问 |
|
500 |
服务内部异常 |
错误码
请参见错误码。